Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

Unit V C Protocols

Uploaded by

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

Unit V C Protocols

Uploaded by

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

Unit V c Protocols

• ARP & RARP


ARP (Address resolution protocol):
• ARP associates an IP address with its physical address. In LAN, each
device on a link is identified by a physical address
ARP Packet
• Hardware type. : This is a 16-bit field defining the type of the network on
which ARP is running. Each LAN has been assigned an integer based on its
type. For ex Ethernet is given type 1.
• Protocol type: This is a 16-bit field defining the protocol
• Hardware length :This is an 8-bit field defining the length of the physical
address in bytes. For example, for Ethernet the value is 6.
• Protocol length: This is an 8-bit field defining the length of the logical
address in bytes. For example, for the IPv4 protocol the value is 4.
• Operation: This is a 16-bit field defining the type of packet. Two packet
types are defined: ARP request (1) andARP reply (2).
• Sender hardware address:This is a variable-length field defining the
physical address of the sender.
• Sender protocol address.: This is a variable-length field defining the logical
(for example, IP) address of the sender.
• Target hardware address: This is a variable-length field defining the
physical address of the target.
• Target protocol address. This is a variable-length field defining the logical
(for example, IP) address of the target.
RARP (Reverse Address resolution protocol)
• RARP finds the logical address for a machine that only knows
its physical address
• Why RARP:diskless machine is usually booted from ROM,
The machine can get its physical address (by reading its NIC, for
example), which is unique locally. machine can not include IP
address.
• It can then use the physical address to get the logical address by
using the RARP protocol.
• A RARP request is created and broadcast on the local network.
The requesting machine must be running a RARP client program
• Another machine on the local network that knows all the IP
addresses will respond with a RARP reply. The responding
machine must be running a RARP server program
• Problem: if an administrator has several networks or several
subnets, it needs to assign a RARP server for each network or
subnet because does not pass the boundaries of a network
IP (internet Protocol)
Functions
■ Addressing: assign unique & universal address
■ Data Encapsulation and Formatting/Packaging: IP accepts
data from the transport layer protocols UDP and TCP. It then
encapsulates this data into an IP datagram using a special for
mat
prior to transmission.

■ Fragmentation and Reassembly: the maximum frame size of


each physical/data-link network using IP may be different. For
this reason, IP includes the ability to fragment IP datagrams
into pieces so they can each be carried on the local network.
■ Routing / Indirect Delivery
IPv4 datagram format
• Version (VER). This 4-bit field defines the version of the IPv4 protocol
• Header length (HLEN). This 4-bit field defines the total length of the
datagram header
• Services:8-bit field. Indicate quality of service desired such as
delay ,throughput , reliability
• Total length :This is a In-bit field that defines the total length (header plus
data) of the IPv4 datagram in bytes
• Identification :This field is used in assembling the fragments
• Flags. This field indicates fragmentation possibliteies
• Fragmentation offset. This field is used in fragmentation
• Time to live. A datagram has a limited lifetime in its travel through an
internet it hold a timestamp, which was decremented by each visited
router.
• Protocol. This 8-bit field defines the higher-level protocol that uses the
services of the IPv4 layer ex:TCP ,UDP
• Checksum. :16 bit value to verify validity of header
• Source address. This 32-bit field defines the IPv4 address of
the source
• Destination address. This 32-bit field defines the IPv4 address
of the destination.
• Option :optional header setting used for security & debugging
IPV6:
Advantages of IPV6
• Larger address space. An IPv6 address is 128 bits long,
• Better header format. IPv6 uses a new header format in which
options are separated from the base header and inserted, when
needed, between the base header and the upper-layer data.
• New options. IPv6 has new options to allow for additional
functionalities.
• Allowance for extension. IPv6 is designed to allow the extension
of the protocol if required by new technologies or applications.
• Support for resource allocation. This mechanism can be used to
support traffic such as real-time audio and video.
• Support for more security. The encryption and authentication
options in IPv6 provide confidentiality and integrity of the packet.
IPv6 datagram header and payload
Format of an IPv6 datagram
• Version. This 4-bit field defines the version number of the IP. For IPv6,
the value is 6.
• Priority. The 4-bit priority field defines the priority of the packet with
respect to traffic congestion.
• Flow label. 3-byte field that is designed to provide special handling for
a particular flow of data
• Payload length. 2-byte payload length field defines the length of the
IP datagram excluding the base header.
• Next header. 1-byte field defining the header that follows the base
header in the datagram.
• Hop limit. 1-byte. hop limit field serves the same purpose as the TTL
field in IPv4.
• Source address. The source address field is a 16-byte Internet address
that identifies the original source of the datagram.
• Destination address.:16-byte (128-bit) Internet address that usually
identifies the final destination of the datagram.
IPv4 IPv6
IPv4 addresses are 32 bit length. IPv6 addresses are 128 bit length.
IPv4 addresses are binary number IPv6 addresses are binary
represented in decimals. numbers represented in hexadecimals.
IPSec support is only optional. Inbuilt IPSec support.
Fragmentation is done by sender and Fragmentation is done only by sender.
forwarding routers.
No packet flow identification. Packet flow identification is available within
the IPv6 header using the Flow Label field.

Checksum field is available in IPv4 header No checksum field in IPv6 header.

Options fields are available in IPv4 header. No option fields, but IPv6 Extension
headers are available.
Broadcast messages are available. Broadcast messages are not available.
Instead a link-local scope "All
nodes" multicast IPv6 address (FF02::1) is
used for broadcast similar functionality.

Manual configuration (Static) of IPv4 Auto-configuration of addresses is available.


addresses or DHCP (Dynamic configuration)
is required to configure IPv4 addresses.
USER DATAGRAM PROTOCOL (UDP)
• UDP is called a connectionless, unreliable transport protocol.
• It does not add anything to the services of IP except to
provide process-to-process communication
• it performs very limited error checking.
• UDP is a very simple protocol using a minimum of overhead. If
a process wants to send a small message and does not care
much about reliability, it can use UDP. It needs very less
interaction between sender & reciver.
• Well known port - 69 TFTP ,169-SNMP
• UDP packets, called user datagrams, have a fixed-size header
of 8 bytes
• Pseudoheaderfor checksum calculation
UDP Operation
• Connectionless Services : This means that each user datagram
sent by UDP is an independent datagram.
• Flow and Error Control : No Flow control ; no error control
mechanism in UDP except for the checksum
• Encapsulation and Decapsulation : To send a message from
one process to another, the UDP protocol encapsulates and
decapsulates messages in an IP datagram
• Queuing : queues are associated with ports . Some
implementations create both an incoming and an outgoing
queue associated with each process. Other implementations
create only an incoming queue associated with each process
Application of UDP
• UDP is suitable for a process that requires simple request-
response communication with little concern for flow and error
control
• UDP is suitable for a process with internal flow and error
control mechanisms
• UDP is a suitable transport protocol for multicasting.
• UDP is used for management processes such as SNMP
• UDP is used for some route updating protocols such as
Routing Information Protocol
• Majorly used in video /audio based applications
Transmission Control Protocol (TCP)
• TCP is a connection oriented protocol
• TCP uses flow and error control mechanisms at the transport
level.
• Reliable
TCP Services
• Process-to-Process Communication :TCP creates an
environment in which the two processes seem to be
connected by an imaginary "tube“ that carries their data
across the Internet .well konwn ports 23 –TELNET ,80-HTTP .
• Full-Duplex Communication
• Connection-Oriented Service : When a process at site A wants
to send and receive data from another process at site B, the
following occurs:
1. The two TCPs establish a connection between them.
2. Data are exchanged in both directions.
3. The connection is terminated.
• Reliable Service :TCP is a reliable transport protocol. It uses an
acknowledgment mechanism to check the safe and sound
arrival of data.
TCP UDP
TCP is a connection-oriented protocol. UDP is a connectionless protocol.
Connection
TCP is suited for applications that UDP is suitable for applications that
require high reliability, and need fast, efficient transmission, such as
transmission time is relatively less games. UDP's stateless nature is also
critical. useful for servers that answer small
queries from huge numbers of clients.
Usage
HTTP, HTTPs, FTP, SMTP, Telnet DNS, DHCP, TFTP, SNMP, RIP, VOIP.
Examples
Ordering of TCP rearranges data packets in the UDP has no inherent order as all
data order specified. packets are independent of each other.
packets
Speed of The speed for TCP is slower than UDP. UDP is faster because there is no error-
transfer checking for packets.
There is absolute guarantee that the There is no guarantee that the messages
data transferred remains intact and or packets sent would reach at all.
arrives in the same order in which it was
Reliability sent.
Header Size TCP header size is 20 bytes UDP Header size is 8 bytes.
Weight TCP is heavy-weight. UDP is lightweight.
Data Flow TCP does Flow Control. UDP does not have an option for flow
Control control
Error TCP does error checking UDP does error checking, but no
Checking recovery options.
Acknowledg Acknowledgement segments No Acknowledgment
ement
Connection oriented
• It is the communication service in which virtual connection is
created before sending the packet over the internet
• It needs authentication of the destination node before
transferring data.
• It is slower than the connectionless service.
• Advantages:
• It is reliable.
• All the packets follow the same path to the destination.
• Disadvantages:
• Handshaking is required before sending an actual data packet
over the internet.
• Requires additional header parameter to ensure reliable
communication between sender and receiver. So, it has extra
overhead.
• Header size of the packet is bigger than connectionless protocol.
Connectionless
• In this communication service, packets are sent without creating
any virtual connection over the internet.
• It transfers the data message without authenticating destination.
• Advantages:
• It sends the packet without handshaking.
• It is faster than connection-oriented protocol.
• The header size of the packet is smaller as compared to the packets
in connection-oriented services.
• Disadvantages:
• It is not reliable and cannot ensure the data transmission to the
destination.
• Packets decide the route while transmission based on the network
congestion.
• It does not have a fixed path.
• Different packets do not necessarily follow the same path.
Protocol Connection Oriented Protocol
Connectionless Protocol Sevices
Characteristics Sevices
It is the communication service in In this communication service,
which virtual connection is created packets are sent without creating
1) Definition
before sending the packet over the any virtual connection over the
internet. internet.
It needs authentication of the It transfers the data message
2) Authentication destination node before transferring without authenticating
data. destination.
This connection does not ensure
3) Reliability more reliable reliability on packet
transmission.
The handshaking is carried out to There is no handshaking happens
4) Handshaking ensure both sender and receiver while sending a packet over the
agree with this connection. network.
It is slower than the connectionless
service. Before sending a packet,
It is faster than connection-
5) Delay the virtual connection is created in
oriented protocol service.
the connection-oriented protocol
which adds extra delay.
Protocol Connection Oriented Protocol
Connectionless Protocol Sevices
Characteristics Sevices
Sending packet in connection-
oriented service requires more
It has less overhead and smaller
6) Overhead parameters in the header of the
packet header size.
packet to ensure the reliable
transmission.
The route is not finalized and
Route is finalized and decided at the
decided on the way while
7) Routing time of handshaking before sending
transferring data packet based on
the actual packet.
the network congestion.
Not necessary all the packets
All the packets between sender and
8) Packet Travel transmitting between sender and
destination follows the same path.
receiver follows the same path.
9) Protocol TCP is connection-oriented
UDP is connectionless protocol.
Example protocol.
Transport Layer Protocol

• Stop-and-Wait
• Sliding window protocol
– Go-Back-N ARQ
– Selective-Repeat ARQ
 Sender keeps a copy of the last packet
Stop-and-Wait until it receives an acknowledgement.
 For identification, both data packets and
acknowledgements (ACK) packets are
numbered alternatively 0 and 1.
 Sender has a control variable (S) that holds
the number of the recently sent packet. (0
or 1)
 Receiver has a control variable ® that
holds the number of the next packet
expected (0 or 1).
 Sender starts a timer when it sends a
packet. If an ACK is not received within a
allocated time period, the sender assumes
that the packet was lost or damaged and
resends it
 Receiver send only positive ACK if the
packet is intact.
 ACK number always defines the number of
the next expected packet
Stop-and-Wait ARQ, lost packet

• When a receiver
receives a damaged
packet, it discards it
and keeps its value of
R.
• After the timer at the
sender expires,
another copy of packet
1 is sent.
Stop-and-Wait, lost ACK packet
• If the sender receives
a damaged ACK, it
discards it.
• When the timer of
the sender expires,
the sender
retransmits packet 1.
• Receiver has already
received packet 1
and expecting to
receive packet 0
(R=0). Therefore it
discards the second
copy of packet 1.
Stop-and-Wait, delayed ACK packet
• The ACK can be delayed
at the receiver or due to
some problem
• It is received after the
timer for packet 0 has
expired.
• Sender retransmitted a
copy of packet 0.
However, R =1 means
receiver expects to see
packet 1. Receiver
discards the duplicate
packet 0.
• Sender receives 2 ACKs,
it discards the second
ACK.
Piggybacking (Bidirectional Transmission)
• A method to
combine a data
packet with ACK.
• Station A and B both
have data to send.
• Instead of sending
separately, station A
sends a data packet
that includes an ACK.
• Station B does the
same thing.
• Piggybacking saves
bandwidth.
Disadvantage of Stop-and-Wait
• In stop-and-wait, at any point in time, there is
only one packet that is sent and waiting to be
acknowledged.
• This is not a good use of transmission medium.
• To improve efficiency, multiple packets should be
in transition while waiting for ACK.
• Two protocol use the above concept,
– Go-Back-N ARQ
– Selective Repeat ARQ
Go-Back-N ARQ
• We can send up to W packets before worrying
about ACKs.
• We keep a copy of these packets until the
ACKs arrive.
• This procedure requires additional features to
be added to Stop-and-Wait ARQ.
Sliding window protocol
Sliding window protocols apply Pipelining :
Go-Back-N ARQ
Selective Repeat ARQ
 Sliding window protocols improve the efficiency
 multiple packets should be in transition while waiting
for ACK. Let more than one packet to be outstanding.
 Outstanding packets: packets sent but not
acknowledged
 We can send up to W packets and keep a copy of these
packets(outstanding) until the ACKs arrive.
 This procedures requires additional feature to be
added :sliding window
Sequence Numbers
• packets from a sender are numbered sequentially.
• We need to set a limit since we need to include the
sequence number of each packet in the header.
• If the header of the packet allows m bits for sequence
number, the sequence numbers range from 0 to 2 m –
1. for m = 3, sequence numbers are: 1, 2, 3, 4, 5, 6, 7.
• We can repeat the sequence number.
• Sequence numbers are:
0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, …
Sender Sliding Window
• At the sending site, to
hold the outstanding
packets until they are
acknowledged, we use
the concept of a window.
• The size of the window is
at most 2m -1 where m is
the number of bits for
the sequence number.
• Size of the window can
be variable, e.g. TCP.
• The window slides to
include new unsent
packets when the correct
ACKs are received
Receiver Sliding Window
• Size of the window at
the receiving site is
always 1 in this
protocol.
• Receiver is always
looking for a specific
packet to arrive in a
specific order.
• Any packet arriving out
of order is discarded
and needs to be resent.
• Receiver window slides
as shown in fig.
Receiver is waiting for
packet 0 in part a.
Control Variables
• Sender has 3 variables: S, SF, and SL
• S holds the sequence number of recently sent packet
• SF holds the sequence number of the first packet
• SL holds the sequence number of the last packet
• Receiver only has the one variable, R, that holds the sequence
number of the packet it expects to receive. If the seq. no. is the
same as the value of R, the packet is accepted, otherwise
rejected.
Acknowledgement
• Receiver sends positive ACK if a packet arrived safe and in order.
• If the packets are damaged/out of order, receiver is silent and
discard all subsequent packets until it receives the one it is
expecting.
• The silence of the receiver causes the timer of the
unacknowledged packet to expire.
• Then the sender resends all packets, beginning with the one with
the expired timer.
• For example, suppose the sender has sent packet 6, but the timer
for packet 3 expires (i.e. packet 3 has not been acknowledged),
then the sender goes back and sends packets 3, 4, 5, 6 again. Thus
it is called Go-Back-N-ARQ
• The receiver does not have to acknowledge each packet received,
it can send one cumulative ACK for several packets.
Go-Back-N ARQ, normal operation
• The sender keeps track of the outstanding packets and
updates the variables and windows as the ACKs arrive.
Go-Back-N ARQ, lost packet
• packet 2 is lost
• When the
receiver receives
packet 3, it
discards packet 3
as it is expecting
packet 2
(according to
window).
• After the timer
for packet 2
expires at the
sender site, the
sender sends
packet 2 and 3.
(go back to 2)
Go-Back-N ARQ, damaged/lost/delayed ACK

• If an ACK is damaged/lost, we can have two situations:


• If the next ACK arrives before the expiration of any timer,
there is no need for retransmission of packets because
ACKs are cumulative in this protocol.
• If ACK1, ACK2, and ACk3 are lost, ACK4 covers them if it
arrives before the timer expires.
• If ACK4 arrives after time-out, the last packet and all the
packets after that are resent.
• Receiver never resends an ACK.
• A delayed ACK also triggers the resending of packets
Go-Back-N ARQ, sender window size
• Size of the sender window must be less than 2 m. Size of the
receiver is always 1. If m = 2, window size = 2 m – 1 = 3.
• Fig compares a window size of 3 and 4.

Accepts as
the 1st
packet in
the next
cycle-an
error
Selective Repeat ARQ, sender and receiver windows
• Go-Back-N ARQ simplifies the process at the receiver site. Receiver only keeps
track of only one variable, and there is no need to buffer out-of-order packets,
they are simply discarded.
• However, Go-Back-N ARQ protocol is inefficient for noisy link. It bandwidth
inefficient and slows down the transmission.
• In Selective Repeat ARQ, only the damaged packet is resent. More bandwidth
efficient but more complex processing at receiver.
• It defines a negative ACK (NAK) to report the sequence number of a damaged
packet before the timer expires.
Selective Repeat ARQ, lost packet • packets 0 and 1
are accepted
when received
because they
are in the range
specified by the
receiver
window. Same
for packet 3.
• Receiver sends
a NAK2 to show
that packet 2
has not been
received and
then sender
resends only
packet 2 and it
is accepted as it
is in the range
of the window.
Selective Repeat ARQ, sender window size
• Size of the sender and receiver windows must be at most one-half of 2 m. If m =
2, window size should be 2 m /2 = 2. Fig compares a window size of 2 with a
window size of 3. Window size is 3 and all ACKs are lost, sender sends duplicate
of packet 0, window of the receiver expect to receive packet 0 (part of the
window), so accepts packet 0, as the 1st packet of the next cycle – an error.
DHCP
❑ The information that is held in each computer attached to a
TCP/IP internet
• Its IP address
• Its subnet mask
• The IP address of a router
• The IP address of a name server
❑ The above information is usually stored in a configuration
file and accessed by the computer during the bootstrap
process
❑ In the case of a diskless computer, the operating system and
networking S/W can be stored in ROM. But the above
information cannot be stored in ROM
BOOTP
• BOOTP(Bootstrap Protocol) is client/server
protocol designed to provide the information
for a diskless computer or a computer that is
booted for the first time
– RARP provides only the IP address and not the
other information
– If we use BOOTP, we do not need RARP
– RARP is not implemented in most systems, it is
totally removed from TCP/IP version 6
BOOTP (cont’d)
• Relay agent
– In case that does not include a BOOTP sever in
each LAN, a remote BOOTP server may serve
several LANs
– If a client needs to be booted, it cannot reach the
remote sever using the broadcast address because
an address of all 1s has only local jurisdiction.
– So, a relay agent is used to send local requests to
remote severs
BOOTP (cont’d)
• Client and server on two different networks
Dynamic Host Configuration Protocol (DHCP)
• BOOTP is not dynamic configuration protocol.
– When a client requests its IP address, the BOOTP sever looks up a
table that matches the physical address of the client with its IP
address.
– This means that the binding between the physical address and the
IP address of the client should already exist.
– What if a host moves from one physical network to another ?
• DHCP is extension to BOOTP and has backward compatible with
BOOTP
– meaning that a host running the BOOTP client can request a static
configuration to a DHCP server
DHCP (Cont’d)
• DHCP provides temporary IP addresses for a limited
period of time
• DHCP has two DBs
– one for statically binding between physical address and IP
address
– the other one with a pool of available IP addresses
• When a DHCP client requests a temporary IP addresses, the
DHCP sever assigns an IP address from a pool for a negotiable
period of time
• When a DHCP client sends a request to a DHCP server
– At first, checking its static database
– If not , selecting an IP address from the available pool
DHCP (Cont’d)
❑ Leasing
• The DHCP server issues a lease for a specific
period of time
• When the lease expires, the client must either
stop using the IP address or renew the lease

❑ DHCP Operation
1. A client broadcasts a DHCPDISCOVER message
using destination port 67
2. Servers respond with a DHCPOFFER message
including an IP address
DHCP (Cont’d)
• If the client receives no DHCPOFER message, it will try four
more times, each with a SPAN of two seconds.
• If there is no reply to any of these DHCPDISCOVERs, the client
sleeps for five minutes before trying again
3. The client chooses one of the offers and sends a
DHCPREQUEST message to the selected sever
4. The server responds with a DHCPACK message and
creates the binding between the client physical address
and its IP address
5. Before 50 percent of the lease period is reached, the
client sends another DHCPREQUEST and asks for
renewal
DHCP (Cont’d)
6. If the server responds with a DHCPACK, the client
has a new lease agreement and can reset its
timer. If the server responds with a DHCPNACK,
the client must immediately stop using the IP
address and find another server (step 1)
7. If the sever does not respond, the client sends
another DHCPREQUEST when the lease time
reaches 87.5 percent. If the client terminates the
lease prematurely, the client sends a
DHCPRELEASE message to the server.

DHCP
DHCP Transition Diagram
(Cont’d)
Network Address Translation ( NAT )

• Use private IP addresses for internal traffic


• At least one global IP address for traffic with external
organizations.
• Only ONE connection to the Internet through a NAT
router.
58
Address translation

 The source IP address of an outgoing packet ( a private IP) is


replaced by one of the global IP addresses maintained by the NAT
router.
 The destination IP address of an incoming packet (the global IP of
the NAT router) is replaced by the appropriate private IP address.

59
NAT Advantages & Disadvantages
•It helps in conserving the IPv4 address space
•It increase the flexibility and the reliability of connections
to the public network by implementing multiple pools,
backup pools and load-balancing pools to.
•Helps in a consistent network addressing scheme. If you
use public IP address, first you’ll get an address space
assigned to you. As your network grows, you’ll have to buy
more and when you buy more, the chance of getting IP
addresses from the same IP address class are minimal and
even zero.
•Get an extra layer of network security. Hosts inside a NAT
network are not reachable by hosts on other networks
unless you want to.
Ravikiran Tirgule
NAT (Network Address Translation) is a processor and
memory resource consuming technology, since NAT
(Network Address Translation) need to translate
IPv4 addresses for all incoming and outgoing IPv4
datagrams and to keep the translation details in memory.
• NAT (Network Address Translation) may cause delay in
IPv4 communication.
• NAT (Network Address Translation) cause loss of end-
device to end-device IP traceability
• Some technologies and network applications will not
function as expected in a
NAT (Network Address Translation)configured network.

You might also like