Unit V C Protocols
Unit V C Protocols
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.
• 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
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 )
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.