Cn-Unit 3
Cn-Unit 3
Advantages:
No setup time: Datagram networks are connectionless and don't
require setup time.
No fixed route: If a link or node fails, there's no need to
reestablish a path.
Fault tolerance: Packets can be routed around busy parts of the
network or when an intermediate system fails.
Flexibility: Datagrams are the most flexible form of
communication, allowing senders and receivers to change along
with priorities.
Efficiency: Datagrams are more efficient than other packet types.
Virtual Circuit(VC) Approach: Connection-Oriented Service
It is a connection-oriented network.
In these networks, the path between the source
and the destination nodes that is followed by first
data packet gets allocated. All other data packets
transmitted between them will use the same path.
All the resources like buffers and bandwidth get
reserved before the transmission, and all data
packets consume same resources.
Since all packets follow the same path, a common
header and routing information is used by them.
They provide greater reliability and less complexity
owing to fixed paths and fixed resources.
3 Phases of Virtual - Circuit Transmission
Set up Phase − In this phase, a virtual circuit or a
route is established from the source to the destination
through number of switches. The source and destination
use global addresses using which the switches make
routing table entries.
Data Transfer − Once the virtual circuit is set up, all
packets follow the route established during the set up
phase adhering to the routing tables.
Teardown Phase − When data transfer is complete, the
source sends a teardown request. The destination
responds using a teardown confirmation. The switches
flush their routing table entries, thus relinquishing the
circuit.
ADDRESSING
Global Addressing:
It is used to create a Virtual-Circuit Identifier(VCI)
Local Addressing (Virtual-circuit identifier) :
It uniquely identifies the connection link at the switch and
carried in the header of the packet.
Advantages of Virtual Circuit:
Packets are delivered to the receiver in the same order sent
by the sender.
Virtual circuit is a reliable network circuit.
There is no need for overhead in each packet.
Single global packet overhead is used in virtual circuit.
Disadvantages of Virtual Circuit:
Virtual circuit is costly to implement.
It provides only connection-oriented service.
Always a new connection set up is required for transmission.
INTERNET PROTOCOL
The Internet Protocol (IP) is a protocol, or set of
rules, for routing and addressing packets of data so
that they can travel across networks and arrive at
the correct destination.
Data traversing the Internet is divided into smaller
pieces, called packets.
IP information is attached to each packet, and this
information helps routers to send packets to the
right place.
Every device or domain that connects to the
Internet is assigned an IP address, and as packets
are directed to the IP address attached to them,
data arrives where it is needed.
Internet Protocol Version 4 (IPv4)
It is connectionless services: Datagram approach
IPv4 could be a 32-bit IP Address.
IPv4 could be a numeric address, and its bits are
separated by a dot.
The number of header fields is twelve and the
length of the header field is twenty.
It has Unicast, broadcast, and multicast-style
addresses.
IPv4 supports VLSM (Virtual Length Subnet
Mask).
IPv4 uses the Post Address Resolution Protocol to
map to the MAC address.
IPv4 Datagram Format
VER - Version (4 bits): Indicates the version
of the IPv4 protocol being used.
HLEN - Header Length (4 bits): Indicates the
length of the header in 32-bit words.
Service - Type of Service (8 bits):
Indicates the priority of the packet and any
special handling that should be applied to it.
It is also called as differentiated services,
which has 3 fields.
Precedence(3 bits): Defines Priority, Ranging
from 0(000 in binary) to 7(111 in binary)
Type of Services (TOS): specify Type of
Services value.
Reserved (R) – 1 bit , reserved for future use.
Service - Type of Service (8 bits)
Type of Service (TOS)
Total Length (16 bits): Indicates the total length
of the packet in bytes, including the header and
data.
Identification (16 bits): A unique number that is
used to identify the packet.
Flags (3 bits): Used to control fragmentation and
reassembly of the packet.
bit 0: Reserved; must be Zero
bit 1: Don’t Fragment (DF)
bit 2: More Fragment (MF)
Fragment Offset (13 bits): Indicates the position
of this fragment in the original packet.
TTL - Time to Live (8 bits): Indicates the
maximum number of hops that the packet can
make before it is discarded.
Protocol (8 bits): Indicates the type of
transport layer protocol being used (e.g. TCP,
UDP).
Header Checksum (16 bits): A checksum that
is used to verify the integrity of the header.
Source IP Address (32 bits): The IP address of
the sender of the packet.
Destination IP Address (32 bits): The IP
address of the intended recipient of the packet.
Options (variable length): Optional fields that
can be used to specify additional information
about the packet.
Fragmentation and Reassembly
It is a method for transmission of messages larger
than the network’s Maximum Transmission
Unit(MTU), Messages are fragmented into smaller
pieces by the sender and reassembled by the
receiver.
Fragmentation is the breaking of an IPV4 packet
that exceeds the MTU of the data link layer into
smaller IPV4 packets. Fragmentation is a process
performed by the sender or the forwarding routers.
Fragmentation relies on some of the fields in the
IPV4 header, which are as follows:
Identification: To identify fragments, we use a 16-bit
field.
When the packet is fragmented, the identification field
is copied into the fragmented packet headers to help
determine that the packet belongs to a specific frame.
Fragment offset: This is a 13-bit field that is used
to order the data into fragments; it helps in the
rearranging part.
MF (More fragments): It is a one-bit flag that
specifies if there are more fragments of the frame.
DF (Don't fragment): It is a one-bit flag that tells
the routers whether to fragment the packet or not.
If it is set to 00 then the packet can be
fragmented.
Reassembly
The reassembly process is carried out at the destination.
This is because packets take different routes through the
network and arrive at different times.
The steps of the process of reassembly are as follows:
The destination identifies that the packet has been
fragmented using the MF and fragment offset fields.
The destination categorizes the incoming packets
according to their identification fields. Two packets with
the same identification field are put in the same category.
The packets within a category are sequenced using the MF
and fragment offset. First, the packets with MF equal
to 11 are sorted in ascending order based on their
fragment offset values. Then the packet having an MF
equal to 00 and a fragment offset not equal to 0 is placed at
the end, since it's the last packet.
IPv4 ADDRESSING
Logical (Universal) Address: 32 bit long(4
bytes), it encodes its network number and
host number. It remains the same.
Physical (Network) Address: It will change
from hop to hop.
ADDRESS SPACE:
It is defined as “The total number of addresses
used by the protocol”.
Eg: For N bits address, 2^N bits address space
can be used.
Notations: 3 types
Binary Notation: 32 bit address(4 byte address)
Dotted-Decimal Notation: 32 bit address
Hexadecimal Notation: 32 bit address