0% found this document useful (0 votes)
1 views

UNIT III Computer Networks-1

The document discusses the concepts of switching in computer networks, detailing circuit-switched, packet-switched, and virtual-circuit networks. It explains the phases of communication in circuit-switched networks and the independent nature of packets in packet-switched networks, including the use of routing tables. Additionally, it covers IPv4 addressing, including its structure, notation, and the classification of addresses into classes A, B, and C.

Uploaded by

uharika44
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

UNIT III Computer Networks-1

The document discusses the concepts of switching in computer networks, detailing circuit-switched, packet-switched, and virtual-circuit networks. It explains the phases of communication in circuit-switched networks and the independent nature of packets in packet-switched networks, including the use of routing tables. Additionally, it covers IPv4 addressing, including its structure, notation, and the classification of addresses into classes A, B, and C.

Uploaded by

uharika44
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Vallurupalli Nageswara Rao Vignana Jyothi Institute of

Engineering &Technology

Department of Computer Science & Engineering

SUBJECT: Computer Networks


Subject Code: 18PC1IT06

Topic Name: Data Link Layer and Medium Access Sub Layer:
III year, sec: D

Dr. P Neelakantan
Professor
Email: [email protected]

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 1


Switching
 A network is a set of connected devices. Whenever there are multiple devices, then
there is a problem of how to connect them to make one-to-one communication
possible.
 One solution is to make a point-to-point connection between each pair of devices (a
mesh topology) or between a central device and every other device (a star topology).
 These methods, however, are impractical and wasteful when applied to very large
networks.
 A switched network consists of a series of interlinked nodes, called switches. Switches
are devices capable of creating temporary connections between two or more devices
linked to the switch.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 2


Switching
 In a switched network, some of
these nodes are connected to
the end systems (computers or
telephones, for example).
Others are used only for
routing. Figure shows a
switched network.
 The end systems
(communicating devices) are
labelled A, B, C, D, and so on,
and the switches are labelled I,
II, III, IV, and V.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 3


Switching
Traditionally, three methods of switching have been important: circuit switching, packet
switching, and message switching. The first two are commonly used today.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 4


Switching
Traditionally, three methods of switching have been important: circuit switching, packet
switching, and message switching. The first two are commonly used today.
CIRCUIT-SWITCHED NETWORKS

A circuit-switched network consists of a set of switches connected by physical links.


A connection between two stations is a dedicated path made of one or more links.
However, each connection uses only one dedicated channel on each link.
Each link is normally divided into n channels by using FDM or TDM.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 5


Switching
The end systems, such as computers or telephones, are directly connected to a switch.
We have shown only two end systems for simplicity.
When end system A needs to communicate with end system M, system A needs to
request a connection to M that must be accepted by all switches as well as by M itself.
This is called the setup phase;
A circuit (channel) is reserved on each link, and the combination of circuits or channels
defines the dedicated path.
After the dedicated path made of connected circuits (channels) is established, data
transfer can take place. After all data have been transferred, the circuits are tom down.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 6


Switching

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 7


Switching
 Circuit switching takes place at the physical layer.
 Before starting communication, the stations must make a reservation for the
resources to be used during the communication. These resources, such as
channels (bandwidth in FDM and time slots in TDM), switch buffers, switch
processing time, and switch input/output ports, must remain dedicated during
the entire duration of data transfer until the teardown phase.
 Data transferred between the two stations are not packetized (physical layer
transfer of the signal). The data are a continuous flow sent by the source station
and received by the destination station, although there may be periods of
silence.
 There is no addressing involved during data transfer. The switches route the
data based on their occupied band (FDM) or time slot (TDM).

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 8


Switching
Three Phases: The actual communication in a circuit-switched network requires
three phases: connection setup, data transfer, and connection teardown.

Setup Phase: Before the two parties (or multiple parties in a conference call) can
communicate, a dedicated circuit (combination of channels in links) needs to be
established. The end systems are normally connected through dedicated lines to the
switches, so connection setup means creating dedicated channels between the
switches.
Data Transfer Phase: After the establishment of the dedicated circuit (channels),
the two parties can transfer data.
Teardown Phase :When one of the parties needs to disconnect, a signal is sent to
each switch to release the resources.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 9


DATAGRAM NETWORKS

In data communications, we need to send messages from one end system to


another.
If the message is going to pass through a packet-switched network, it needs to
be divided into packets of fixed or variable size. The size of the packet is
determined by the network and the governing protocol.
In packet switching, there is no resource allocation for a packet. This means that
there is no reserved bandwidth on the links, and there is no scheduled processing
time for each packet.
Resources are allocated on demand. The allocation is done on a first-come, first-
served basis. When a switch receives a packet, no matter what is the source or
destination, the packet must wait if there are other packets being processed.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 10


DATAGRAM NETWORKS

In a datagram network, each packet is treated independently of all others.


Packets in this approach are referred to as datagrams. Datagram switching is
normally done at the network layer.
Figure A datagram network with four switches (routers)

The above figure shows how the datagram approach is used to deliver four packets
from station A to station X. The switches in a datagram network are traditionally
referred to as routers. That is why we use a different symbol for the switches in
the figure.
Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 11
DATAGRAM NETWORKS

Routing Table
If there are no setup or teardown phases, the packets are routed to their destinations by
using a routing table.
In this type of network, each switch (or packet switch) has a routing table which is based
on the destination address.
The routing tables are dynamic and are updated periodically. The destination addresses and
the corresponding forwarding output ports are recorded in the tables.
This is different from the table of a circuit switched network in which each entry is created
when the setup phase is completed and deleted when the teardown phase is over. Figure
8.8 shows the routing table for a switch.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 12


DATAGRAM NETWORKS

Destination Address
Every packet in a datagram network
contains the destination address of the
packet.
When the switch receives the packet, this
destination address is examined; the
routing table is consulted to find the
corresponding port through which the
packet should be forwarded.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 13


DATAGRAM NETWORKS

VIRTUAL-CIRCUIT NETWORKS
A virtual-circuit network is a cross between a circuit-switched network and a datagram
network. It has some characteristics of both.
1. As in a circuit-switched network, there are setup and teardown phases in addition to
the data transfer phase.
2. Resources can be allocated during the setup phase, as in a circuit-switched network,
or on demand, as in a datagram network.
3. As in a datagram network, data are packetized and each packet carries an address in
the header.
4. As in a circuit-switched network, all packets follow the same path established
during the connection.
5. A virtual-circuit network is normally implemented in the data link layer, while a
circuit-switched network is implemented in the physical layer and a datagram
network in the network layer. But this may change in the future.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 14


DATAGRAM NETWORKS

Global Addressing
A source or a destination needs to have a global address-an address that can be unique
in the scope of the network.
Virtual-Circuit Identifier
The identifier that is used for data transfer is called the virtual-circuit identifier (VCI).
A VCI unlike a global address, is a small number that has only switch scope; it is used
by a frame between two switches.
When a frame arrives at a switch, it has a VCI; when it leaves, it has a different VCl.
Figure 8.11 shows how the VCI in a data frame changes from one switch to another.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 15


DATAGRAM NETWORKS

Global Addressing
A source or a destination needs to have a global address-an address that can be unique
in the scope of the network.
Virtual-Circuit Identifier
The identifier that is used for data transfer is called the virtual-circuit identifier (VCI).
A VCI unlike a global address, is a small number that has only switch scope; it is used
by a frame between two switches.
When a frame arrives at a switch, it has a VCI; when it leaves, it has a different VCl.
Figure 8.11 shows how the VCI in a data frame changes from one switch to another.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 16


Virtual Circuit
Setup Request : A setup request frame is sent from the source to the
destination.
Acknowledgment A special frame, called the acknowledgment frame,
completes the entries in the switching tables.
Teardown Phase
In this phase, source A, after sending all frames to B, sends a special frame
called a teardown request. Destination B responds with a teardown
confirmation frame. All switches delete the corresponding entry from their
tables.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 17


Virtual Circuit
In the setup phase, a
switch creates an
entry for a virtual
circuit. For example,
suppose source A
needs to create a
virtual circuit to B.
Two steps are
required: the setup
request and the
acknowledgment.
Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 18
Switching

To transfer a frame from a source to its destination, all switches need to have a
table entry for this virtual circuit. The table has four columns. Figure 8.12 shows a
frame arriving at port 1 with a VCI of 14. When the frame arrives, the switch looks
in its table to find port 1 and a VCI of 14. When it is found, the switch knows to
change the VCI to 22 and send out the frame from port 3.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 19


Network Layer: Logical Addressing

Communication at the network layer is host-to-host (computer-to-computer); a


computer somewhere in the world needs to communicate with another computer
somewhere else in the world.
Usually, computers communicate through the Internet.
The packet transmitted by the sending computer may pass through several LANs or
WANs before reaching the destination computer.
For this level of communication, there is a need for global addressing scheme
also called logical addressing.
IP address is used to mean a logical address in the network layer of the TCP/IP
protocol suite. The Internet addresses are 32 bits in length; this gives us a maximum
of addresses. These addresses are referred to as IPv4 (IP version 4) addresses or
simply IP addresses.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 20


IPv4 ADDRESSES
An IPv4 address is a 32-bit address that uniquely and universally defines the
connection of a device (for example, a computer or a router) to the Internet.

IPv4 addresses are unique.


They are unique in the sense that each address defines one, and only one,
connection to the Internet. Two devices on the Internet can never have the same
address at the same time.(However two devices can receive different IP
addreses at different times)

Address Space

A protocol such as IPv4 that defines addresses has an address space. An address
space is the total number of addresses used by the protocol. If a protocol uses N
bits to define an address, the address space is .

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 21


IPv4 ADDRESSES
Notations
There are two prevalent notations to show an IPv4 address: binary notation and
dotted decimal notation.
Binary Notation
In binary notation, the IPv4 address is displayed as 32 bits. Each octet is often
referred to as a byte. Hence an IPv4 address referred to as a 32-bit address or a 4-
byte address. The following is an example of an IPv4 address in binary notation:
01110101 10010101 00011101 00000010
Dotted-Decimal Notation
To make the IPv4 address more compact and easier to read, Internet
addresses are usually written in decimal form with a decimal point (dot) separating
the bytes. The following is the dotted decimal notation of the above address:
117.149.29.2

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 22


IPv4 ADDRESSES
The below figure shows an IPv4 address in both binary and dotted-decimal
notation. Note that because each byte (octet) is 8 bits, each number in dotted-
decimal notation is a value ranging from 0 to 255.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 23


IPv4 ADDRESSES
Classful Addressing
IPv4 addressing, at its inception, used the concept of classes and this architecture is
called classful addressing.
In classful addressing, the address space is divided into five classes: A, B, C, D, and
E. Each class occupies some part of the address space. In classful addressing, the
address space is divided into five classes: A, B, C, D, and E.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 24


IPv4 ADDRESSES
Classes and Blocks
One problem with classful addressing is that each class is divided into a fixed number
of blocks with each block having a fixed size as shown in Table 19.1.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 25


IPv4 ADDRESSES
Class A addresses were designed for large organizations with a large number of
attached hosts or routers.
Class B addresses were designed for midsize organizations with tens of thousands of
attached hosts or routers.
Class C addresses were designed for small organizations with a small number of
attached hosts or routers.
However, there is a flaw in this design. A block in class A address is too large for
almost any organization. This means most of the addresses in class A were wasted
and were not used. class
B is also very large, probably too large for many of the organizations that received a
class B block.
class C is probably too small for many organizations.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 26


IPv4 ADDRESSES
Netid and Hostid
In classful addressing, an IP address in class A, B, or C is divided into netid and
hostid.
These parts are of varying lengths, depending on the class of the address.
In class A, one byte defines the netid and three bytes define the hostid.
In class B, two bytes define the netid and two bytes define the hostid.
In class C, three bytes define the netid and one byte defines the hostid.
Mask
Although the length of the netid and hostid (in bits) is predetermined in classful
addressing, A mask with 32-bit number made of contiguous 1’s followed by
contiguous 0’s. The masks for classes A, B, and C are shown in Table 19.2. The
concept does not apply to classes D and E.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 27


IPv4 ADDRESSES
Subnetting
If an organization was granted a large block in class A or B, it could divide the
addresses into several contiguous groups and assign each group to smaller
networks (called subnets).
Supernetting
The size of a class C block with a maximum number of 256 addresses did not satisfy
the needs of most organizations.
Even a midsize organization needed more addresses. One solution was supernetting.
In supernetting, an organization can combine several class C blocks to create a
larger range of addresses. In other words, several networks are combined to
create a supernetwork.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 28


Network Address Translation (NAT)

The number of home users and small businesses that want to use the Internet is ever
increasing.
In the beginning, a user was connected to the Internet with a dial-up line, which
means that she was connected for a specific period of time.
An ISP with a block of addresses could dynamically assign an address to this user.
An address was given to a user when it was needed.
But the situation is different today. Home users and small businesses can be
connected by an ADSL line or cable modem.
In addition, many are not happy with one address; many have created small networks
with several hosts and need an IP address for each host. With the shortage of
addresses, this is a serious problem.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 29


Network Address Translation (NAT)

A quick solution to this problem is called network address translation (NAT).


NAT enables a user to have a large set of addresses internally and one address, or a
small set of addresses, externally.
The traffic inside can use the large set, the traffic outside, the small set.
To separate the addresses used inside the home or business and the ones used for the
Internet, the Internet authorities have reserved three sets of addresses as private
addresses, shown in Table 19.3.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 30


IPV4 format
IP stands for Internet Protocol, which is a set of rules for sending and
receiving data over the internet. The "v4" in IPv4 refers to Version 4, the
fourth version of this protocol. IPv4 is the most widely used version and was
introduced in 1983 for use in ARPANET (an early version of the internet).
IPv4 addresses are 32-bit numbers. These addresses are written in a format
called decimal notation to make them easier for humans to read. For example,
an IPv4 address like 192.168.1.5 represents a 32-bit number in four sections.
What is IPv4?
IPv4 is a connectionless protocol. This means it doesn't establish a dedicated
connection between devices before sending data, unlike a telephone call.
Instead, IPv4 sends data in small, independent packets called datagrams,
which travel across the network individually and may take different paths to
the destination.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 31


IPV4 format
IPv4 is used in many different types of networks, such as Ethernet (the most
common type of wired local area network). It helps connect devices by
assigning each device a unique address called an IP address. This address
acts like a home address for devices, making sure data reaches the correct
destination.

Classes of IPv4 Addresses


IPv4 addresses are grouped into five different classes:
 Class A: Used for large networks (e.g., big companies or organizations).
 Class B: Used for medium-sized networks.
 Class C: Used for small networks (like home or small office networks).
 Class D: Reserved for multicasting (sending data to multiple devices at
once).
 Class E: Reserved for experimental or military purposes.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 32


IPV4 format

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 33


IPV4 format
Here’s a breakdown of the key fields in the IPv4 header:
 Version: Indicates the version of the IP protocol being used. For IPv4, this is
always 4.
 Header Length (HLEN): Specifies the length of the IP header in 32-bit blocks.
This tells how many pieces of information are included in the header. The
minimum value is 5 (which means 20 bytes), and the maximum is 15 (60
bytes).
 Type of Service (TOS): This field specifies the priority and handling of the
packet. For example, packets can be marked for low delay or high throughput.
This helps routers decide how to handle the packet.
 Total Length: This is the size of the entire datagram (header + data) in bytes.
The size can be between 20 and 65,535 bytes.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 34


IPV4 format
 Identification: Each datagram is assigned a unique ID number to help track and
reassemble fragments of a large packet if it’s broken up.
 Flags: Control flags, such as:
 DF (Do not Fragment): Tells routers not to fragment the datagram.
 MF (More Fragments): Indicates if more fragments are coming.
 Fragment Offset: When a large packet is broken into smaller pieces, this field
tells where each fragment belongs in the original packet.
 Time to Live (TTL): This prevents packets from traveling endlessly through the
network. Each router that forwards the packet decreases the TTL by 1. When
the TTL reaches 0, the packet is discarded.
 Protocol: Specifies which higher-level protocol is used for the data inside the
datagram (e.g., TCP, UDP).

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 35


IPV4 format
 Header Checksum: This value is used to detect errors in the header. If an error
is found, the packet is discarded.
 Source IP Address: The IP address of the device that sent the packet.
 Destination IP Address: The IP address of the device the packet is being sent
to.
 Options: Optional features that can be added, such as a record route (tracking the
path a packet takes) or timestamp (when the packet was sent).

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 36


THANK YOU

Department of Computer Science & Engineering, VNRVJIET, Hyderabad February 6, 2025 37

You might also like