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

Protocols

The document explains IPv4 addressing, detailing the structure of 32-bit addresses and the hierarchical nature of addressing, which includes classes A, B, C, D, and E. It discusses classful and classless addressing, including subnetting and supernetting strategies to combat address depletion, and introduces special addresses like private and multicast addresses. Additionally, it covers Network Address Translation (NAT) and its function in translating private IP addresses to public ones for communication over the internet.

Uploaded by

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

Protocols

The document explains IPv4 addressing, detailing the structure of 32-bit addresses and the hierarchical nature of addressing, which includes classes A, B, C, D, and E. It discusses classful and classless addressing, including subnetting and supernetting strategies to combat address depletion, and introduces special addresses like private and multicast addresses. Additionally, it covers Network Address Translation (NAT) and its function in translating private IP addresses to public ones for communication over the internet.

Uploaded by

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

IPv4 Addressing : Address Space

• An IPv4 address is a 32-bit address used to uniquely identify the connection of a


host or a router to the Internet.
• IP address is address of connection ; not the address of host or router , because the
device is moved to another network , IP address may be changed.
• IP addresses are globally managed by Internet Assigned Numbers Authority(IANA).
• Address Space:
• An address space is the total number of addresses used by the protocol.
• IPv4 uses 32-bit addresses, which means that the address space is 232 or
4,294,967,296 (more than four billion)
• Notations:
IPv4 Addressing :Address Space

• Hierarchy in Addressing:
• In any communication network that involves delivery, such as a telephone network or a postal
network, the addressing system is hierarchical.
• In a postal network, the postal address includes the country, state, city, street, house number
• A 32-bit IPv4 address is also hierarchical, but divided into two parts.:
• The first part of the address, called the prefix, defines the network;
• the second part of the address, called the suffix, defines the node(host)

• A prefix can be fixed length( Classful Addressing) or variable length ( Classless Addressing)
IPv4 Addressing:Classful Addressing

• In classful addressing address space is divided into five classes :class A, B, C, D, and E

• In class A, one byte defines the netid (prefix) and three bytes define the hostid (suffix).
• 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.
IPv4 Addressing:Classful Addressing

• In classful addressing each class is divided into a fixed number of blocks with
each block having a fixed size as shown in Table.

Table : Number of blocks and block size in classful IPv4 addressing

Actual No. of Blocks or


Network Host Block Size or Range of IP
Leading Network
Class Identifier Identifier Max. number Address in Dotted Application
Bits Identifier Max. number of
Bits Bits of hosts decimal notations
Bits Networks
0.0.0.0 to Unicast(Large
A 0 8 7 27=128 24 224=1,67,77,216
127.255.255.255 organizations)
128.0.0.0 to Unicast(Midsize
B 10 16 14 214=16,384 16 216=65,536
191.255.255.255 organizations)
192.0.0.0 to Unicast(Small
C 110 24 21 221=20,97,152 8 28=256
223.255.255.255 organizations)
224.0.0.0 to
D 1110 - - - - - Multicasting
239.255.255.255
240.0.0.0 to Reserved for
E 1111 - - - - -
255.255.255.255 future use
IPv4 Addressing:Classful Addressing:

• Subnet Mask:
• The purpose of subnet mask is to identify which part of an IP address is network
part and which part is host part.
• Subnet mask is a 32 bit number created by setting network bits to all 1s and setting
host bits to all 0s.

Table : Default masks for classful addressing

• The last column of Table shows the mask in the form /n where n can be 8, 16, or 24 in classful
addressing.
• This notation is also called slash notation or Classless Interdomain Routing (CIDR) notation.
IPv4 Addressing:Classful Addressing:
Example: Find the error, if any, in the following IPv4
addresses.

Solution:
a. There must be no leading zero (045).
b. There can be no more than four bytes in IP address.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
19.6
IPv4 Addressing:Classful Addressing:

Example :Find the class of each address.


a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

Solution:
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
19.7
IPv4 Addressing:Classful Addressing

• Address Depletion(Reduction in addresses):


• Due to address depletion, classful addressing is almost obsolete(no longer useful) and is
replaced with classless addressing.
• To solve problem of address depletion, two strategies were proposed and, to some extent,
implemented: Subnetting and Supernetting
• Subnetting divides one large network into multiple small networks.
• Supernetting combines multiple small networks into one larger network.
IPv4 Addressing : Classless addressing

• In Classless addressing, the whole address space is divided into variable length blocks.
• The prefix in an address defines the block (network); the suffix defines the node (hosts).
• We can have a block of 1 address, 2 addresses, 4 addresses, 128 addresses, and so on.
• Restrictions on classless address blocks:
1. The addresses in block must contiguous , one after another.
2. The number of addresses in a block needs to be a power of 2.
3. The first address must be evenly divisible by the number of addresses.
IPv4 Addressing : Classless addressing
• Prefix Length: Slash Notation
• In classless addressing prefix length is variable.
• We can have a prefix length that ranges from 0 to 32.
• In classless address, the prefix length, n, is added to the address, separated by a slash.
• The notation is informally referred to as slash notation and formally as classless interdomain
routing or CIDR (pronounced cider) strategy
• An address in classless addressing can be represented as shown in Figure 18.20.
IPv4 Addressing: Classless addressing

• Extracting Information from an Address:


1.The number of addresses in the block is found as N = 2 32−n.
2. To find the first address, we keep the n leftmost bits as its and set the (32 − n) rightmost
bits all to 0s.
3. To find the last address, we keep the n leftmost bits as its and set the (32 − n) rightmost bits
all to 1s
IPv4 Addressing: Classless addressing

• Extracting Information from an Address:


Example:
A classless address is given as 167.199.170.82/27. find number of addresses in the block, first
address and last address in block.
We can find the above three pieces of information as follows.
• The number of addresses in the block are: 2 32 − n = 25 = 32 addresses.
• The first address can be found by keeping the first 27 bits in address as its and changing the
rest of the bits to 0s.
• The last address can be found by keeping the first 27 bits in address as its and changing the
rest of the bits to 1s.
IP Address: 167.199.170.82/27 10100111 11000111 10101010 01010010
First address: 167.199.170.64/27 10100111 11000111 10101010 01000000
Last address: 167.199.170.95/27 10100111 11000111 10101010 01011111

• The first address in a block is normally not assigned to any host;


The first address is called as the network address that represents the organization itself to
the rest of the world.
• The last address in a block is normally not assigned to any host;
The last address is called as the broadcast address used to send packets to all hosts in a
particular network.
IPv4 Addressing: Classless addressing
Example :A block of addresses is granted to a small
organization. We know that one of the addresses is
205.16.37.39/28. What is the first address in the block?

Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.

19.13
IPv4 Addressing: Classless addressing

Example: Find the last address for the block in


205.16.37.39/28.
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47

19.14
IPv4 Addressing: Classless addressing

Example :Find the number of addresses for the block in


205.16.37.39/28.
Solution: The number of addresses in the block can be
found by using the formula 232−n

The value of n is 28, which means that number of addresses


are= 2 32−28
=24
= 16

19.15
Example 19.9

Another way to find the first address, the last address, and
the number of addresses is to represent the mask as a 32-bit
binary number.
In Example 205.16.37.39/28
the /28 can be represented as
11111111 11111111 11111111 11110000
(twenty-eight 1s and four 0s).

Find
a. The first address
b. The last address

19.16
Example 19.9 (continued)

Solution
a. The first address can be found by ANDing the given
addresses with the mask. ANDing here is done bit by
bit. The result of ANDing 2 bits is 1 if both bits are 1s;
the result is 0 otherwise.

19.17
Example 19.9 (continued)

b. The last address can be found by ORing the given


addresses with the complement of the mask. ORing
here is done bit by bit. The result of ORing 2 bits is 0 if
both bits are 0s; the result is 1 otherwise. The
complement of a number is found by changing each 1
to 0 and each 0 to 1.

19.18
IPv4 Addressing : Classless addressing
• Special Addresses: are not assigned to any host in a network and are used for special
purposes:
• This-host Address :The only address in the block 0.0.0.0/32 is called the this-host address.
• It is used when host want to know its own IP address then host use this address as source
address in packet and send packet to Bootstrap server(DHCP server) .

• Limited-broadcast Address :The only address in the block 255.255.255.255/32 is called


the limited-broadcast address.
• It is used when host wants to broadcast packet to all devices in a network then host use this
address as destination address in packet and send packet to all devices in a network .

• Loopback Address :The block 127.0.0.0/8 (127.0.0.0-127.255.255.255) is called the


loopback address.
• Its used when host wants to send packet to itself.(i.e. host can test its own connection)
• Loopback address 127.0.0.1 used to test network software on your computer
IPv4 Addressing : Classless addressing
• Special Addresses:
• Private Addresses: are used by organizations to create their own intranet.
• Four blocks are assigned as private addresses:
• 10.0.0.0/8(10.0.0.0 to 10.255.255.255)
• 172.16.0.0/12 (172.16.0.0 to 172.31.255.255)
• 192.168.0.0/16(192.168.0.0. to 192.168.255.255)
• 169.254.0.0/16(169.254.0.1 to 169.254.255.255) (Automatic Private IP addressing)
• With Automatic Private IP addressing computer can assign an IP address to itself, in
case of DHCP server not working or not available on a network .

• Multicast Addresses :The block 224.0.0.0/4 (224.0.0.0 to 239.255.255.255) is reserved


for multicast addresses.
• Its used when host wants to send packet to group of devices in a network
IPv4 Addressing
Classful Addressing Classless Addressing
In classful addressing address space is divided In classless addressing, the whole
into five classes :class A, B, C, D, and E, address space is divided into variable
each class is divided into a fixed length blocks length blocks.

it allocates IP addresses according to five Its IP address allocation method


major classes such as Class A,B,C,D,E designed to replace the classful
addressing
It uses fixed length prefix it uses variable length prefix
It uses fixed length subnet mask it uses variable length subnet mask
Its less effective method of allocating IP Its more effective method of allocating
addresses IP addresses
Its less practical. Its more practical.
It does not support Classless Inter-Domain It supports Classless Inter-Domain
Routing (CIDR). Routing (CIDR).
It requires more bandwidth . As a result, it It requires less bandwidth. Thus, fast and
becomes slower and more expensive as less expensive as compared to classful
compared to classless addressing. addressing.
IPv4 Addressing
Network Address Translation (NAT)
• Its process used to translates the private IP address to the public IP address and vice
versa.
• Due to NAT, the computers in a private network are able to communicate with the
computer in the public network.

• As the figure shows, the private network uses private addresses.


• The router that connects the private network to the internet uses two addresses : one
is private address and another is public(global) address.
• The private network is invisible to the rest of the Internet;
• the rest of the Internet sees only the NAT router with the address 200.24.5.8.
Network Address Translation (NAT)
• Address Translation:
• For every outgoing packet, NAT router, replaces the private source address in the packet with
its global address and then packet forwarded to internet.
• For every incoming packet ,NAT router, replaces the destination address in the packet with
the appropriate private destination address and then packet is forwarded to particular
destination in a private network. Figure 18.30 shows an example of address translation.
Network Address Translation (NAT)
• Translation Table: It has two columns: the private address and the Universal(External)
address
• When the router translates the source address of the outgoing packet , it make note of source
address and destination address(where the packet is going) of packet in translation table.
• When the response comes back from the destination, the router uses the source address of the
packet to find the private address of the packet. Figure 18.31 shows the idea.
Network Address Translation (NAT)
• Example of NAT : suppose, if the tablet user at home network wants the
information about today’s news.
Difference between IPv4 and IPv6 Protocol
IPv4 IPv6
IPv4 addresses are 32 bits length. IPv6 addresses are 128 bits length.
IPv4 address space is 232 (i.e. 4.3 billion addresses) IPv6 address space is 2128
(i.e. 340 trillion trillion trillion addresses)
IPv6 addresses are represented in colon hexadecimal
IPv4 addresses are represented in dotted decimal notation.
notation
Length of header is 20 to 60 bytes Length of header is fixed 40 bytes
Checksum field is available in IPv4 header No Checksum field in IPv6 header.
Options fields are available in IPv4 header. In IPv6 option fields replaced with Extension headers

Fragmentation is done by sender and routers. Fragmentation is done only by sender.


IPSec support is only optional. Inbuilt IPSec support.
Packet flow identification is available in the IPv6 header
No packet flow identification.
using the Flow Label field.
Manual (Static) or DHCP (Dynamic) is required to
Auto-configuration of addresses is available.
configure IPv4 addresses.
Address Resolution Protocol (ARP) is available to map Address Resolution Protocol (ARP) is replaced with a
IPv4 addresses to MAC addresses. function of Neighbor Discovery Protocol (NDP).
Internet Group Management Protocol (IGMP) is used to IGMP is replaced with Multicast Listener Discovery (MLD)
manage multicast group membership. messages.

Broadcast messages are available. Broadcast messages are not available.


19.27
Network Layer Services
• Connection-Oriented Vs Connectionless Network Service
• Delivery of a packet can be accomplished by using either a connection-oriented or a
connectionless network service.
• In a connection-oriented service, the source first makes a connection with the destination
before sending a packet.
• When the connection is established , then source sent a sequence of packets to destination
one after another.
• In connection-oriented service, there is a relationship between packets. Packets are sent on
the same path in sequential order.
• When all packets of a message have been delivered, the connection is terminated.

• In a connection less service, the source does not makes any connection with the
destination.
• source sent a set of packets to destination without establishing connection with destination.
• In connection-less service, there is a no relationship between packets. Packets are sent on
the same path or on different path
Network Layer Protocols
• Internet Protocol version 4 (IPv4) is responsible for packetizing, forwarding, and
delivery of a packet at the network layer.
• The Internet Control Message Protocol version 4 (ICMPv4) helps IPv4 to handle some
errors that may occur in the network-layer delivery.
• The Internet Group Management Protocol (IGMP) is used to help IPv4 in multicasting.
• The Address Resolution Protocol (ARP) is used mapping network-layer addresses to
link-layer addresses. (it find MAC address of device from its IP address.)
• Figure 19.1 shows the positions of these four protocols in the TCP/IP protocol suite.
Internet Protocol(IP)
• IPv4 is an unreliable datagram protocol—a best-effort delivery service.
• The term best-effort means that IPv4 packets can be corrupted, be lost, arrive out of
order, or be delayed, and may create congestion for the network.
• If reliability is important, IPv4 must be paired with a reliable protocol such as TCP.
• An example of best-effort delivery service is the post office.
• The post office does its best to deliver the letters but does not always succeed.
• IPv4 is also a connectionless protocol that uses the datagram approach.
• Datagram approach means that each datagram is handled independently, and each
datagram can follow a different route to the destination.
Internet Protocol(IP) :Datagram format
• Datagram format: Packets used by IP are called datagram
• A datagram is a variable-length packet consisting of two parts: header and payload (data).
• The size of datagram is 20 to 65535 bytes
• The header is same as envelope of letter
• The Header consists information necessary for routing and delivery of packet.
• The size of header is 20 to 60 bytes
Internet Protocol(IP) :Datagram format
• Datagram format fields:
• Version Number(4 bits):it defines the version of the IPv4 protocol, In this case version of IP
protocol is 4.
• Header Length(4 bits): it defines the length of IP datagram header.
• The minimum length of header is 20 bytes and maximum length of header is 60 bytes

• Total Length (16-bit) :it defines the total length of IP datagram including header and data.
Total length 216 =65536
Total length = Header length+ payload(data) length.
payload(data) length = Total length – Header length.
Internet Protocol(IP) :Datagram format
• Datagram format fields:
• Service Type(8-bit) : IETF(Internet Engineering Task Force) has changed the interpretation
and name of this field. This field, previously called service type, is now called differentiated
service

• Precedence: is a 3-bit subfield ranging from 0 (000 in binary) to 7 (111 in binary).


• The precedence defines the priority of the datagram in case of congestion.
• In case of congestion router needs to discard some datagrams, then datagrams with lowest
precedence are discarded first.

• TOS bits: is a 4-bit subfield with each bit having a special


meaning.
• Each bit can be either 0 or 1
• Only one of the bits can have the value of 1 in each datagram.
Internet Protocol(IP) :Datagram format
• Datagram format fields:
• Differentiated Services: In this interpretation, the first 6 bits make up the codepoint
subfield, and the last 2 bits are not used.
• The codepoint subfield can be used in two different ways:
• When the 3 rightmost bits are 0’s, then 3 leftmost bits are same as the precedence bits in
the service type.
• When the 3 rightmost bits are not all 0’s, then 6 codepoint bits defines 64 services
• The first category contains 32 service types; the second and third category contain 16
service types.
• The first category (numbers 0, 2,4, ... ,62) is assigned by the Internet authorities (IETF).
• The second category (3, 7, 11, 15,…. , 63) can be used by local authorities (organizations).
• The third category (1, 5, 9, ….,61) is temporary and can be used for experimental purposes.
Internet Protocol(IP) :Datagram format
• Datagram format fields:
• Identification(16 Bit ):its unique number that identifies set of fragment of single
datagram.
• The combination of Identification and IPv4 address uniquely identifies datagram.
• If datagram divided into multiple fragments then all the fragments must have same
Identification number.

• Flags(3bits) :It defines three flags


• The leftmost bit is reserved (not used).
• The second bit (D bit) is called the do not fragment bit.
• If its value is 1, the machine will not fragment the datagram.
• If its value is 0, the datagram can be fragmented ,if necessary.
• The third bit (M bit) is called the more fragment bit.
• If its value is 1, it means the datagram is not the last fragment; there are more fragments
after this one.
• If its value is 0, it means this is the last fragment.
Internet Protocol(IP) :Datagram format
• Fragmentation Offset(13-bit): it defines relative position of fragment with respect to
whole datagram.
• Figure 19.6 shows a datagram with a data size of 4000 bytes fragmented into three
fragments.
• The bytes in the original datagram are numbered 0 to 3999.
• The first fragment carries bytes 0 to 1399. The offset for this datagram is 0/8 = 0.
• The second fragment carries bytes 1400 to 2799; the offset value for this fragment is
1400/8 = 175.
• Finally, the third fragment carries bytes 2800 to 3999. The offset value for this fragment is
2800/8 = 350
• Remember that the value of the offset is measured in units of 8 bytes.
Internet Protocol(IP) :Datagram format
• Datagram format fields:
• Time-to-live(8 bit): This field limits lifetime of datagram in a network.
• It controls the maximum number of hops (routers) visited by the datagram.
• When a source host sends the datagram, it stores a value in this field.
• TTL Value=2 * maximum number of routers between any two hosts.
• Each router that processes the datagram, decrements this value by one.
• If value of TTL becomes zero before reaching destination, then router discards the datagram.

• Protocol(8 bit): it defines name of protocol to which data is to be passed.


• It also defines higher level protocol which uses service of IPv4.
• Protocol number for(ICMP is 1),(IGMP is 2),(TCP is 6)(UDP is 17) (OSPF is 89)

• Header checksum (16 bit): It consist checksum value for checking errors in the datagram
header.
• Source Addresses (32-bit) : it defines the IP address of the source.
• Destination Addresses (32-bit) : it defines the IP address of the destination.

• Options: A datagram header can have up to 40 bytes of options.


• Options can be used for network testing and debugging purpose.
• Payload: is a actual data that source want to transfer to destination
Internet Protocol(IP) :Fragmentation
• Fragmentation: means dividing large datagram into small parts, each part is called
fragment.
• If the size of the datagram is larger than the Maximum Transfer Unit(MTU) of
network then datagram can be fragmented.
• A datagram can be fragmented by the source host or any router in the path.
• Datagram may be fragmented several times before it reaches the final destination.
• Fragmented datagram can travel through different routes.
• When a datagram is fragmented, each fragment has its own header .
• The reassembly of the datagram is done only by the destination host
Internet Protocol(IP) :Fragmentation
Internet Protocol(IP) :Options
• Header of IPv4 datagram consists of two parts: Fixed part (20 bytes long) and .
• Variable part(max. upto 40 bytes) that consists different options.
• Options are not required for datagram but they can be used for network testing and
debugging purpose.

• No-operation option is used as a filler(fill out space) between options.


Internet Protocol(IP) :Options
• End-of-option: It is used to
makes the end of header options of
IP datagram.
• After this option, the receiver looks
for the payload data.
• It can only be used as the last
option.

• Record route option: it is used


to record IP address of routers
through which datagram passes
from source to destination.
• This option can record up to 9
routers addresses.
Internet Protocol(IP) :Options
Internet Protocol(IP) :Options
• Strict source route:
• Its used by source, to specify a route
for datagram and datagram need to
follow that route strictly.
• If the datagram visits a router that is
not in the list then datagram is
discarded and error message is issued.

• Loose source route :


• It is similar with strict source route but
it is more flexible.
• Each router in the list must be visited,
but the datagram can also visit other
routers as well.
Internet Protocol(IP) :Options
• Timestamp :
• It is used to record time required by
router for processing datagram.
• With help of timestamp option ,we
can estimate the time taken by a
datagram to travel from one router to
another router.
• This time is measured in millisecond.
ICMPv4: Messages
• If any error occurs during transmission of packet , then router discards packet .
• IP does not have an inbuilt mechanism for sending error and control messages.
• IP depends on ICMP to provide error control.
• ICMP is used for reporting errors and management queries.
• ICMP does not correct errors-it simply reports them.

• ICMP messages: are divided into two broad categories:


• The error-reporting messages :
• if any error occurs during transmission of packet from source to destination then
intermediate router sends an ICMP error message to the source informing about the
error.
• The query messages:
• A host or a network manager get specific information from a router or another host
using query messages.
ICMPv4: Messages

• ICMP Message has an 8-byte header and a variable-size data section.


• Type field, defines the type of the message.
• Code field defines reason for the particular message.
• Checksum field defines value for checking errors in the datagram.
• The Rest of the header is specific for each message type.
• The Data section in error messages, carries information for finding the original packet that had the error.
• The Data section in query message carries extra information based on the type of the query.
ICMPv4: Error Reporting Messages
• Destination Unreachable:
• when router cannot route a datagram to destination, then datagram is discarded and the router
sends a destination-unreachable message back to the source host .
• For e.g. when we use the HTTP protocol to access a web page, but the server is down. The
message “destination host is unreachable” is created and sent back to the source.

• Source Quench:
• source quench message informs the sender that the network has encountered congestion and
the datagram has been dropped; the source needs to slow down sending more datagrams.
ICMPv4: Error Reporting Messages
• Redirection Message:
• It’s used when the source uses a wrong router to send out its packet then router forwards
packet to appropriate router and sends redirection message to source ,to informs the source to
update its routing table.
• The IP address of the default router is sent in the message.

• Parameter Problem :
• When router detects problem in the header of a datagram or some options of header are
missing then router sends the “Parameter Problem” message to source.
ICMPv4: Error Reporting Messages
• Time exceeded message: Time exceeded message informs the source, datagram is
discarded due to the time to live field value reached zero.
ICMPv4: Query Messages
• Query Messages:
• query messages come in pairs: request and reply.
• The echo request and echo reply pair of messages are used by a host to test
another host is alive or not.
• The host sends echo request message to another host ,if the another host is
alive ,then it responds with an echo reply message.

• timestamp request and timestamp reply :


• The hosts can use the timestamp request and timestamp reply messages to determine
the round-trip time needed for an IP datagram to travel from source to destination.
• It can also be used to synchronize the clocks in two machines.
ICMPv4 : Debugging Tools
• Debugging Tools: We can determine the availability of a host or router.
• Two tools that use ICMP for debugging: ping and traceroute.
• Ping: The ping program to find if a host is alive and responding.
• The source host sends ICMP echo-request messages to the destination, if destination
host is alive, then it responds with ICMP echo-reply messages.
• Example:
ICMPv4 : Debugging Tools
• The program Traceroute(In UNIX) or Tracert(In Windows):can be used to display route
that a packet takes to reach the destination.
• This is a program at the application level that uses the services of UDP.

• The first column corresponds to the hop count.


• The second column represents the address of that hop and after that, you see three space-
separated time in milliseconds. traceroute command sends three packets to the hop and each
of the time refers to the time taken by the packet to reach the hop.
ICMPv4 : Checksum
• In ICMP the checksum is calculated over the entire message(Header and Data).
• Checksum calculation:
1. The sender follows these steps using one’s complement arithmetic:
2. The checksum field is set to be zero.
3. The sum of all the 16 bit words (header and data)is calculated.
4. The sum is complemented to get the checksum.
5. The checksum is stored in the checksum field.

• Checksum Testing:
1. The sum of all words (header and data)is calculated.
2. The sum is complemented.
3. If the result obtained in step 2 is 16 0s, the message is accepted ; otherwise, it is
rejected.
ICMPv4 : Checksum
• Example:Figure 19.11 shows an example of checksum calculation for a simple echo-request
message. We randomly chose the identifier to be 1 and the sequence number to be 9. The
message is divided into 16-bit (2-byte) words. The words are added and the sum is
complemented. Now the sender can put this value in the checksum field.
ARP
• It is Internet layer of TCP/IP model.
• It is used to map an IP address to physical address known as MAC address.
• It is essential for communication within a local network as data needs to be
delivered to a specific device’s hardware address on that network segment.
• Mapping IP address to MAC address
Working of ARP
• It is used in IPV4 networks.
• When a device wants to communicate with another device on the same
local network, it uses ARP to determine the destination device’s MAC
address.
Step by step process:
• ARP Request
• ARP Reply
• Updating ARP cache
• Data transmission
Step by step process
• ARP Request : When device (Host X)needs to send data to another
device(Host Y) on the local network it checks its ARP cache.(IP to MAC
address mapping).
• If Host X doesn’t have Host Y’S MAC address in it’s ARP cache , it broadcast
an ARP request packet on the network asking who has IP address X.X.X.X?

• ARP Reply: All devices on the local network receive the ARP request but only
Host Y recognizes its IP address in the request.
• Host Y sends an ARP reply back to host X with its MAC address.

• Updating ARP cache : Host X receives the ARP Reply and updates ARP cache
with the IP to MAC mapping for Host Y, allowing Host X to use information
for future communication
Step by step process
• Data Transmission: With MAC address now known, Host X encapsulates the
data into a frame with Host Y’s MAC address as destination and send it over
the network.
Message Format
Message Format
• 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.
Message Format
• 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.
ARP Message Field
• Target protocol address
• Sender protocol address
• Protocol size(1 byte)
• Opcode (2 bytes)
• Target hardware address(6 bytes)
• Sender hardware address(6 bytes)
• Protocol Type(2 bytes)
• Hardware type(2 bytes)
• Hardware size(1 byte)
Advantages & disadvantages Of ARP

Advantages
• Efficiency
• Network communication
Disadvantages
• Spoofing
• Poisoning
• Excessive broadcast traffic
RARP
• It is used to link MAC address with an IP address. Reverse Address Resolution
Protocol.
• It maps an IP address to MAC address.
• It is used to allow a device typically a diskless workstation or device without a
preconfigured IP address, to obtain its IP address from a network server using
its only its MAC address.
• It performs in a way that is exactly opposite to that of the ARP.
• 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
Message Format Of RARP
Message Format Of 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
Message Format Of RARP
• 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.
Message Format Of RARP
• 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
Advantages &disadvantages of RARP
Advantages:
• Simplification of device configuration and management for those lacking
storage or configuration for storing their IP addresses.
• Reduction of overhead and complexity by eliminating manual assignment of
individual IP addresses to each device
Disadvantages:
• need for a server on each network segment, reliance on broadcasts
• lack of security
• inability to provide additional configuration information like subnet masks
or gateways.
Transport Layer Protocols
TCP:
• TCP stands for Transmission Control Protocol.
• TCP protocol provides transport layer services to applications.
• TCP protocol is a connection-oriented protocol.
• A secured connection is being established between the sender and the
receiver.
• For a generation of a secured connection, a virtual circuit is generated
between the sender and the receiver.
• The data transmitted by TCP protocol is in the form of continuous byte
streams.
• A unique sequence number is assigned to each byte. With the help of this
unique number, a positive acknowledgment is received from receipt.
• If the acknowledgment is not received within a specific period the data is
retransmitted to the specified destination.
TCP Packet Format
TCP Packet Format
• Source Port Address: The port address of the programme sending the data
segment is stored in the 16-bit field known as the source port address.
• Destination Port Address: The port address of the application running on the
host receiving the data segment is stored in the destination port address, a 16-
bit field.
• Sequence Number: The sequence number, or the byte number of the first byte
sent in that specific segment, is stored in a 32-bit field. At the receiving end, it
is used to put the message back together once it has been received out of
sequence.
• Acknowledgement Number :This represents the next expected TCP octet.
• Header Length (HLEN): This 4-bit field stores the number of 4-byte words in
the TCP header, indicating how long the header is.
TCP Packet Format
• Control flags: These are six 1-bit control bits that regulate flow control,
method of transfer, connection abortion, termination, and establishment.
• Urgent: This pointer is legitimate
• ACK: The acknowledgement number (used in cumulative
acknowledgement cases) is valid.
• PSH: Push request
• RST: Restart the link.
• SYN: Sequence number synchronisation
• FIN: Cut off the communication
• Window size: This parameter provides the sender TCP's window size in
bytes.
TCP Packet Format
• Checksum: The checksum for error control is stored in this field. Unlike UDP,
it is required for TCP.
• Urgent pointer: This field is used to point to data that must urgently reach the
receiving process as soon as possible. It is only valid if the URG control flag is
set.
Advantages & Disadvantages of TCP

Advantages:
• TCP supports multiple routing protocols.
• TCP protocol operates independently of that of the operating system.
• TCP protocol provides the features of error control and flow control.
• TCP provides a connection-oriented protocol and provides the delivery of data
Disadvantages:
• TCP protocol cannot be used for broadcast or multicast transmission.
• TCP protocol has no block boundaries.
• No clear separation is being offered by TCP protocol between its interface,
services, and protocols.
• In TCP/IP replacement of protocol is difficult.
UDP
• UDP stands for User Datagram Protocol.
• User Datagram Protocol provides a nonsequential transmission of data. It is a
connectionless transport protocol.
• UDP protocol is used in applications where the speed and size of data
transmitted is considered as more important than the security and reliability.
User Datagram is defined as a packet produced by User Datagram Protocol.
UDP protocol adds checksum error control, transport level addresses, and
information of length to the data received from the layer above it.
• Services provided by User Datagram Protocol(UDP) are connectionless
service, faster delivery of messages, checksum, and process-to-process
communication.
UDP Segment

• While the TCP header can range from 20 to 60 bytes, the UDP header is a
fixed, basic 8 bytes.
UDP Segment

• Source Port: Source Port is a 2 Byte long field used to identify the port
number of the source.
• Destination Port: This 2-byte element is used to specify the packet's
destination port.
• Length: The whole length of a UDP packet, including the data and header. The
field has sixteen bits.
• Cheksum: The checksum field is used for error checking of the header and
data.
Advantages & disadvantages of UDP

Advantages:
• UDP also provides multicast and broadcast transmission of data.
• UDP protocol is preferred more for small transactions such as DNS lookup.
• It is a connectionless protocol, therefore there is no compulsion to have a
connection-oriented network.
• UDP provides fast delivery of messages.
Disadvantages:
• In UDP protocol there is no guarantee that the packet is delivered.
• UDP protocol suffers from worse packet loss.
• UDP protocol has no congestion control mechanism.
• UDP protocol does not provide the sequential transmission of data.

You might also like