Outline
- Reliable transmission:
- Alternating Bit Protocol
- Sliding Window Protocol
- sequence number size
- Virtual Circuits
Stop-and-Wait
- Send a packet, wait for ack.
- If ack is not received within timeout, retransmit frame.
- two possibilities:
- ack is lost, sender retransmits
- ack is received, sender transmits next packet
receiver must be able to distinguish the two cases
- [ ==> ] we need a 1-bit sequence number to distinguish the
two cases
- Alternating-Bit Protocol
Sliding Window
- Stop-and-Wait with multiple outstanding packets
- window size W
- last ack received by sender is LAR
- sender can send up to LAR + W
- new ack moves LAR, allowing sender to send more packets
- next packet expected by receiver is NPE
- maximum packet expected by receiver is NPE + W - 1
- any packet outside this range is discarded
- cumulative ack sent when NPE changes
Sliding Window
- reliable delivery
- if W >= bandwidth * delay, the "pipe" remains
full of bits (if receiver is faster than the network)
- in-order packet delivery is easy
- flow control is easy:
- receiver could withhold acks (leading to retransmissions)
- receiver might tell sender to reduce W
- separation of concerns: one mechanism, many functions
Sequence Numbers
- why should receiver discard packets outside the window?
- Stop-and-Wait is sliding window with W=1
- Stop-and-Wait receiver must discard packet other than
expected, since it is an old retransmission (due to lost ack)
- sliding window receiver must be able to distinguish W
valid packets from W retransmitted packets
- [ ==> ] sliding window receiver must
be able to distinguish 2W different packets
- [ ==> ] sequence number space must be at least 2W,
e.g. we need at least 5 bits if W=16
- delayed acks require much more than 2W
in-class exercise
- how fast can we transmit data if we have:
- network bandwidth 10Mb/s (10^7 bits/s)
- network round-trip delay 100ms (10^{-1}s)
- window size 12.5KB (1.25 * 10^4 bytes)
- assume:
- the network does not lose any packets
- cumulative acks
- the acks do affect the amount of bandwidth available in the
"forward" direction
- write down the number visibly on a sheet of paper and hold it up at
the end of the exercise
Packet and Circuit switching
- packet switching: each packet is forwarded independently of
other packets, even though they may have the same source and
destination address (connectionless)
- examples: Ethernet, FDDI, IP
- circuit switching: each packet is forwarded as part of a
connection. A connection must be established before any packet
can be sent, and must be torn down to reclaim the resources
associated with the connection (connection-oriented)
- examples: ATM, TCP, telephone
Packet and Circuit switching
- packet switching:
- simpler to use
- provides less information (both to the network and to the host)
- has no persistent state -- must use caching for efficiency
- circuit switching:
- provides more information -- e.g. bandwidth and delay requirements or
guarantees, how many senders are using this link
- has persistent state
- requires connection setup and teardown, state management
Virtual Circuit Switching
- provides many circuits on a single link
- each packet on a link is tagged with a virtual circuit identifier (VCI)
- the VCI has local significance only, is not an end-to-end identifier:
the same VCI can be reused for different connections on different links
- because the same VCI can be reused for different connections on
different links, it can be allocated independently for each link (no
co-ordination among switches is needed)
- forwarding means identifying the connection, rewriting the VCI, placing
on output port
Virtual Circuit Example
- I am a switch with two ports, A and B
- port A is connected to host x
- port B is connected to a switch which is connected to hosts y and z
- I have two virtual circuits, one from x to y, one from x to z
- the VC from x to y has VCI 0 on port A, and VCI 1 on port B
- the VC from x to z has VCI 1 on port A, and VCI 0 on port B
- a packet on port A with VCI=0 must be from x to y, I place it
on port B with VCI=1
- a packet on port B with VCI=0 must be from z to x