Advanced Computer Network
Advanced Computer Network
c) Class C (192-223)
o In a class C address, the first octet would always start with ‘110’.
o The first 24 bits or the first three octets denote the network portion and the rest 8 bits or the
remaining one octet belong to the host portion.
o Its Subnet mask is 255.255.255.0.
o Number of IP address possible = 2^29 (12.5% of total)
o Number of network possible= 2^21
o Number of host possible in each network=2^8 but usable 2^8-2
d) Class D (224-239)
o first octet would always start with ‘1110’ (11100000-11101111).
o Its Subnet mask is not defined.
o Number of IP address possible= 2^28(6.25% of total)
o It has no network or host Id because all address of this classes are reserved for multicasting and
group broadcasting.
e) Class E (240-255)
o The first octet in a class E address starts with ‘1111’.
o Its Subnet mask is not defined.
o Class E addresses are reserved for research purposes, military purposes and future use.
o Number of IP addresses possible = 2^^28 (6.25% of total).
(3) IPv4
- IP stands for Internet Protocol and v4 stands for Version Four (IPv4). IPv4 was the primary version
brought into action for production within the ARPANET in 1983.
- Connectionless and datagram Service
- Network layer protocol
- It operates on a best-effort delivery model, in which neither delivery is guaranteed, nor proper
sequencing or avoidance of duplicate delivery is assured.
- IPv4 could be a 32-Bit IP Address.
- The number of header fields is twelve and the size of the header ranges form 20-60 bytes.
Header Format
Fragmentation in IPv4
In IPv4, when a packet is larger than the Maximum Transmission Unit (MTU) of the network link it
needs to traverse, it is fragmented into smaller packets. Each of these fragments contains a portion of
the original packet, along with additional information that identifies the fragment’s position in the
original packet and how it fits into the sequence of fragments.
When a packet is received at the router, destination address is examined and MTU is determined. If size
of the packet is bigger than the MTU, and the ‘Do not Fragment (DF)’ bit is set to 0 in header, then the
packet is fragmented into parts and sent one by one. The maximum size of each fragment is the MTU
minus the IP header size (Minimum 20 bytes and Maximum 60 bytes).
Each fragment is converted to a packet and the following changes happen in the datagram header:
(a) The total length field is changed to the size of the fragment.
(b) The More Fragment bit (MF bit) is set for all the fragment packets except the last one.
(c) The fragment offset field is set, based on the number of fragments that is being set and the MTU.
(d) Header Checksum is re-calculated.
(4) IPv6
o 128-bit IP address
Version (4-bits): Indicates version of Internet Protocol which contains bit sequence 0110.
Traffic Class (8-bits): The Traffic Class field indicates class or priority of IPv6 packet which is
similar to Service Field in IPv4 packet. It helps routers to handle the traffic based on the priority
of the packet. If congestion occurs on the router, then packets with the least priority will be
discarded.
Flow Label (20-bits): Flow Label field is used by a source to label the packets belonging to the
same flow in order to request special handling by intermediate IPv6 routers, such as non-default
quality of service or real-time service. In order to distinguish the flow, an intermediate router
can use the source address, a destination address, and flow label of the packets. Between a
source and destination, multiple flows may exist because many processes might be running at
the same time. Routers or Host that does not support the functionality of flow label field and
for default router handling, flow label field is set to 0. While setting up the flow label, the source
is also supposed to specify the lifetime of the flow.
Payload Length (16-bits): It is a 16-bit (unsigned integer) field, indicates the total size of the
payload which tells routers about the amount of information a particular packet contains in its
payload. The payload Length field includes extension headers (if any) and an upper-layer packet.
In case the length of the payload is greater than 65,535 bytes (payload up to 65,535 bytes can
be indicated with 16-bits), then the payload length field will be set to 0 and the jumbo payload
option is used in the Hop-by-Hop options extension header.
Next Header (8-bits): Next Header indicates the type of extension header (if present)
immediately following the IPv6 header. Whereas in some cases it indicates the protocols
contained within upper-layer packets, such as TCP, UDP.
Hop Limit (8-bits): Hop Limit field is the same as TTL in IPv4 packets. It indicates the maximum
number of intermediate nodes IPv6 packet is allowed to travel. Its value gets decremented by
one, by each node that forwards the packet and the packet is discarded if the value decrements
to 0. This is used to discard the packets that are stuck in an infinite loop because of some
routing error.
Source Address (128-bits): Source Address is the 128-bit IPv6 address of the original source of
the packet.
Destination Address (128-bits): The destination Address field indicates the IPv6 address of the
final destination (in most cases). All the intermediate nodes can use this information in order to
correctly route the packet.
Extension Headers: In order to rectify the limitations of the IPv4 Option Field, Extension Headers
are introduced in IP version 6. The extension header mechanism is a very important part of the
IPv6 architecture. The next Header field of IPv6 fixed header points to the first Extension Header
and this first extension header points to the second extension header and so on.
IPv4 IPv6
IPv4 has a 32-bit address length IPv6 has a 128-bit address length
In IPv4 end to end, connection integrity is In IPv6 end-to-end, connection integrity is
Unachievable Achievable
It can generate 4.29×109 address space The address space of IPv6 is quite large it can
produce 3.4×1038 address space
The Security feature is dependent on the IPSEC is an inbuilt security feature in the IPv6
application protocol
In IPv4 Packet flow identification is not In IPv6 packet flow identification are Available and
available uses the flow label field in the header
In IPv4 checksum field is available In IPv6 checksum field is not available
It has a broadcast Message Transmission In IPv6 multicast and anycast message transmission
Scheme scheme is available
In IPv4 Encryption and Authentication facility In IPv6 Encryption and Authentication are provided
not provided
IPv4 has a header of 20-60 bytes. IPv6 has a header of 40 bytes fixed
IPv4’s IP addresses are divided into five IPv6 does not have any classes of the IP address.
different classes. Class A, Class B, Class C, Class
D, Class E.
IPv4 supports VLSM (Variable Length subnet IPv6 does not support VLSM.
mask).
Example of IPv4: 66.94.29.13 Example of IPv6:
2001: 0000: 3238: DFE1:0063:0000:0000:FEFB
- Routing is the process of selecting an optimal path across one or more networks. The Routing is
performed on many types of networks like circuit-switched and packet-switching on the internet, where
packets are forwarded from one node to another node with the help of a packet forwarding system.
- The set of predefined rules used by the routers to maintain the communication between the source
and the destination are known as Routing Protocols. These protocols help to find the routes between
two nodes on the computer network.
Based on local knowledge, since it updates table Based on global knowledge, it has knowledge about
based on information from neighbors. entire network.
Converges slowly i.e, good news spread fast and bad Converges faster.
news spread slowly.
Persistent looping problem i.e, loop will be there No persistent loops, only transient loops.
forever.
Practical implementation is RIP and IGRP. Practical implementation is OSPF and ISIS.
ARP (2017)
- Address Resolution Protocol (ARP) is a communication protocol used to find the MAC (Media Access
Control) address of a device from its IP address. This protocol is used when a device wants to
communicate with another device on a Local Area Network or Ethernet.
- It broadcast a packet to all the devices of the source network. The devices of the network peel the
header of the data link layer from the Protocol Data Unit (PDU) called frame and transfer the packet to
the network layer (layer 3 of OSI) where the network ID of the packet is validated with the destination
IP’s network ID of the packet and if it’s equal then it responds to the source with the MAC address of
the destination.
- After resolving the MAC address, the ARP sends it to the source where it is stored in a table for future
reference. The subsequent communications can use the MAC address from the table.
- ARP request(broadcast): broadcasting a packet over the network to validate whether we came across
the destination MAC address or not.
o The physical address of the sender.
o The IP address of the sender.
o The physical address of the receiver is FF:FF:FF:FF:FF: FF or 1’s.
o The IP address of the receiver.
- ARP response/reply(unicast): It is the MAC address response that the source receives from the
destination which aids in further communication of the data.
RARP (2018)
- The Reverse Address Resolution Protocol (RARP) is a networking protocol that is used to map a physical
(MAC) address to an Internet Protocol (IP) address.
- RARP was developed in the early days of computer networking as a way to provide IP addresses to
diskless workstations or other devices that could not store their own IP addresses. With RARP, the
device would broadcast its MAC address and request an IP address, and a RARP server on the network
would respond with the corresponding IP address.
- employed by a client computer to request its IP address from a gateway server’s Address Resolution
Protocol table or cache. The network administrator creates a table in gateway-router, which is used to
map the MAC address to corresponding IP address.
RARP ARP
To obtain the IP address of a network device To obtain the MAC address of a network device
when only its MAC address is known when only its IP address is known
Client broadcasts its MAC address and Client broadcasts its IP address and requests a
requests an IP address, and the server MAC address, and the server responds with
responds with the corresponding IP address the corresponding MAC address
Rarely used in modern networks as most Widely used in modern networks to resolve IP
devices have a pre-assigned IP address addresses to MAC addresses
RARP stands for Reverse Address Resolution ARP stands for Address Resolution Protocol
Protocol
In RARP, we find our own IP address In ARP, we find the IP address of a remote
machine
The MAC address is known and the IP address The IP address is known, and the MAC address
is requested is being requested
It uses the value 3 for requests and 4 for It uses the value 1 for requests and 2 for
responses responses
- Hardware type: This is 16 bits field defining the type of the network on which ARP is running. Ethernet
is given type 1.
- Protocol type: This is 16 bits field defining the protocol. The value of this field for the IPv4 protocol is
0800H.
- Hardware length: This is an 8 bits field defining the length of the physical address in bytes. Ethernet is
the value 6.
- Protocol length: This is an 8 bits field defining the length of the logical address in bytes. For the IPv4
protocol, the value is 4.
- Operation (request or reply): This is a 16 bits field defining the type of packet. Packet types are ARP
request (1), and ARP reply (2).
- Sender hardware address: This is a variable length field defining the physical address of the sender. For
example, for Ethernet, this field is 6 bytes long.
- Sender protocol address: This is also a variable length field defining the logical address of the sender
For the IP protocol, this field is 4 bytes long.
- Target hardware address: This is a variable length field defining the physical address of the target. For
Ethernet, this field is 6 bytes long. For the ARP request messages, this field is all Os because the sender
does not know the physical address of the target.
- Target protocol address: This is also a variable length field defining the logical address of the target. For
the IPv4 protocol, this field is 4 bytes long.
RARP
Hardware Address Type: It is 2-byte field. It is type of hardware MAC address present in the packet. For
Ethernet, the value of this field is 1.
Protocol Address Type (PTYPE): It is 2-byte field. It is type of the protocol address requested for the MAC
address. For IP address the value of this field is 0*100.
Hardware length (HLEN): It is 1–byte field. It indicates the size of the hardware MAC address. For Ethernet,
the value of this field is 6.
Protocol length (PLEN): It is 1 byte field. It indicates the size of the protocol address. For IP, the value of this
field is 4.
Operation: It is a 2-byte field. It indicates the type of operation being performed. The value of this field can
be 3 (RARP request) or 4 (RARP reply).
Sender Hardware Address: It is 6-byte field. In a RARP request packet, this is the hardware MAC address of
the source host. In a RARP reply packet, this is the hardware MAC address of the RARP server sending the
RARP reply.
Sender Protocol Address: It is 4-byte field. In a RARP request packet, this is undefined. In a RARP reply
packet, this is the IP address of the RARP server sending the RARP reply.
Target Hardware Address: It is 6–byte field. In a RARP request packet, this is the hardware MAC address of
the source host. In a RARP reply packet, this is the hardware MAC address of the host, that sent the RARP
request packet.
Target Protocol Address: It is 4-byte field. In a RARP request packet, this is undefined. In a RARP reply
packet, this is the IP address of the host that sent the RARP request packet.
(10) ICMP (M2018)
- Internet Control Message Protocol (ICMP) is a network layer protocol used to diagnose communication
errors by performing an error control mechanism.
- ICMP is used for error reporting if two devices connect over the internet and some error occurs, So, the
router sends an ICMP error message to the source informing about the error.
- It doesn’t need to establish a connection with the destination device before sending any message as it
is a connectionless protocol.
- ICMP or Internet Control Message Protocol is one of the major protocols of the TCP/IP. ICMP is a
mechanism used by the host, routers, and gateways to send error messages back to the sender. As the
IP does not provide any mechanism for error reporting and control, ICMP has been designed to
compensate for these deficiencies of the IP. However, it only reports the error and doesn't correct the
error.
(12) Ques: Why do HTTP, FTP, SMTP and POP3 run on top of TCP rather than UDP?
TCP is a connection-oriented Protocol and is suited for applications which use high reliability and where
transmission time is relatively less critical for applications than that use UDP.
o Whereas UDP needs applications that need fast, efficient transmission such as games.
o Its feature of handling small queries from huge number of clients is useful for servers. Hence, this is
the reason why TCP is the most commonly used application protocol for HTTP, FTP, SMTP, IMAP,
POP3.
o Also, Because TCP is more reliable, and HTTP, FTP, SMTP, and POP3cannot be affordable using UDP
while UDP cannot transmit packet and guarantee a well order delivery.
TCP is a connected-oriented network so packet will be delivered to the destination.
(14) OSPF
- Open Shortest Path First (OSPF) is a link-state routing protocol that is used to find the best path
between the source and the destination router using its own Shortest Path First).
- It is an intradomain protocol, which means that it is used within an area or a network. It is an interior
gateway protocol that has been designed within a single autonomous system.
- OSPF divides the autonomous systems into areas where the area is a collection of networks, hosts, and
routers. Like internet service providers divide the internet into a different autonomous system for easy
management and OSPF further divides the autonomous systems into Areas. Routers that exist inside
the area flood the area with routing information. In Area, the special router also exists. The special
routers are those that are present at the border of an area, and these special routers are known as
Area Border Routers. This router summarizes the information about an area and shares the
information with other areas. All the areas inside an autonomous system are connected to the
backbone routers, and these backbone routers are part of a primary area. The role of a primary area is
to provide communication between different areas.
- Packet Format: