Arp, Rarp, Icmp
Arp, Rarp, Icmp
Arp, Rarp, Icmp
IPv6
Flexible support for options: more efficient and flexible options encoded in optional extension headers Flow label capability: flow label to identify a packet flow that requires a certain QoS Security: built-in authentication and confidentiality Large packets: supports payloads that are longer than 64 K bytes, called jumbo payloads. Fragmentation at source only: source should check the minimum MTU along the path No checksum field: removed to reduce packet processing time in a router
Version
Traffic Class
Payload Length Next Header
Flow Label
Hop Limit
Source Address
Destination Address
Version field same size, same location Traffic class to support differentiated services Flow: sequence of packets from particular source to particular destination for which source requires special handling
Version
Traffic Class
Payload Length Next Header
Flow Label
Hop Limit
Source Address
Destination Address
Payload length: length of data excluding header, up to 65535 B Next header: type of extension header that follows basic header Hop limit: # hops packet can travel before being dropped by a router
Address Categories Unicast: single network interface Multicast: group of network interfaces, typically at different locations. Packet sent to all. Anycast: group of network interfaces. Packet sent to only one interface in group, e.g. nearest. Hexadecimal notation Groups of 16 bits represented by 4 hex digits Separated by colons
4BF5:AA12:0216:FEBC:BA5F:039A:BE9A:2176
IPv6 Addressing
Shortened forms:
4BF5:0000:0000:0000:BA5F:039A:000A:2176 To 4BF5:0:0:0:BA5F:39A:A:2176 To 4BF5::BA5F:39A:A:2176
Mixed notation:
::FFFF:128.155.12.198
0000 0001
0000 001 0000 010 0000 011 0000 1 0001 001 010 011 100 101 110 1110 1111 0 1111 10 1111 110 1111 1110 0 1111 1110 10 1111 1110 11 1111 1111
Unassigned
ISO network addresses IPX network addresses Unassigned Unassigned Unassigned Unassigned Provider-based unicast addresses Unassigned Geographic-based unicast addresses Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Link local use addresses Site local use addresses Multicast addresses
0.39
0.78 0.78 0.78 3.12 6.25 12.5 12.5 12.5 12.5 12.5 12.5 6.25 3.12 1.56 0.78 0.2 0.098 0.098 0.39
Registry ID: ARIN, RIPE, APNIC ISP Subscriber ID: subnet ID & interface ID
Extension Headers
Daisy chains of extension headers
Basic header Next header = TCP TCP segment
TCP segment
43
44 51 52 60
Routing header
Fragment header Authentication header Encapsulating security payload header Destination options header
Extension Headers
Large Packet: payload>64K
0 Next header 8 0 Jumbo payload length 16 194 24 31 Opt len = 4
Extension Headers
Source Routing: strict/loose routes
0 8 16 24 31
Next header
Reserved
Header length
Routing type = 0
Strict/loose bit mask
Segment left
Address 1
Address 2
...
Address 24
IPv4 header
IPv6 network
Source Link
Destination
ARP associates an IP address with its physical address. On a typical physical network, such as a LAN, each device on a link is identified by a physical or station address that is usually imprinted on the NIC
Case 1
Case 2
Case 3
Case 4
Example
A host with IP address 130.23.43.20 and physical address B2:34:55:10:22:10 has a packet to send to another host with IP address 130.23.43.25 and physical address A4:6E:F4:59:83:AB (which is unknown to the first host). The two hosts are on the same Ethernet network. Show the ARP request and reply packets encapsulated in Ethernet frames. Figure shows the ARP request and reply packets. Note that the ARP data field in this case is 28 bytes, and that the individual addresses do not fit in the 4-byte boundary. That is why we do not show the regular 4-byte boundaries for these addresses. Also note that the IP addresses are shown in hexadecimal.
Proxy ARP
RARP
RARP finds the logical address for a machine that only knows its physical address.
The RARP request packets are broadcast; the RARP reply packets are unicast.
RARP operation
RARP Packet
Fragment at router
IP
Network
Network
TCP
Reliable byte-stream service More complex transmitter & receiver
Connection-oriented: full-duplex unicast connection between client & server processes Connection setup, connection state, connection release Higher header overhead Error control, flow control, and congestion control Higher delay than UDP
transfers a contiguous stream of bytes across the network, with no indication of boundaries groups bytes into segments transmits segments as convenient (Push function defined)
Reliability
Application Transport
Error Detection & Retransmission
ACKS, sequence #
buffer
Flow Control
Buffer limitations & speed mismatch can result in loss of data that arrives at destination Receiver controls rate at which sender transmits to prevent buffer overflow
Application Transport buffer segments advertised window size < B buffer used
buffer available = B
Congestion Control
Available bandwidth to destination varies with activity of other users Transmitter dynamically adjusts transmission rate according to network congestion as indicated by RTT (round trip time) & ACKs Elastic utilization of network bandwidth
Application Transport
RTT Estimation
TCP Multiplexing
A TCP connection is specified by a 4-tuple (source IP address, source port, destination IP address, destination port) TCP allows multiplexing of multiple connections between end systems to support multiple applications simultaneously Arriving segment directed according to connection 4-tuple
1 2
...
...
...
TCP IP A
(A, 6234, B, 80) (A, 5234, B, 80)
TCP IP
B (C, 5234, B, 80)
TCP IP
C
16
24 Destination port
31
Options
Padding
Data
Each TCP segment has header of 20 or more bytes + 0 or more bytes of data
TCP Header
Port Numbers A socket identifies a connection endpoint
IP address + port
Sequence Number Byte count First byte in segment 32 bits long 0 SN 232-1 Initial sequence number selected during connection setup
TCP Header
Acknowledgement Number SN of next byte expected by receiver Acknowledges that all prior bytes in stream have been received correctly Valid if ACK flag is set
Header length 4 bits Length of header in multiples of 32-bit words Minimum header length is 20 bytes Maximum header length is 60 bytes
TCP Header
Reserved 6 bits
Control 6 bits URG: urgent pointer flag
Urgent message end = SN + urgent pointer
ACK: ACK packet flag PSH: override TCP buffering RST: reset connection
Upon receipt of RST, connection is terminated and application layer notified
TCP Header
Window Size 16 bits to advertise window size Used for flow control Sender will accept bytes with SN from ACK to ACK + window Maximum window size is 65535 bytes
TCP pseudoheader
TCP Header
Options Variable length NOP (No Operation) option is used to pad TCP header to multiple of 32 bits Time stamp option is used for round trip measurements Options Maximum Segment Size (MSS) option specifices largest segment a receiver wants to receive Window Scale option increases TCP window from 16 to 32 bits
Host B
Each end can announce its MSS during connection establishment Default is 576 bytes including 20 bytes for IP header and 20 bytes for TCP header Ethernet implies MSS of 1460 bytes IEEE 802.3 implies 1452
Client-Server Application
Host A (client) Host B (server)
connect returns t3
t5
read returns
t2
Nagle Algorithm
Situation: user types 1 character at a time
Transmitter sends TCP segment per character (41B) Receiver sends ACK (40B) Receiver echoes received character (41B) Transmitter ACKs echo (40 B) 162 bytes transmitted to transfer 1 character!
TCP sends data & waits for ACK New characters buffered Send new characters when ACK arrives Algorithm adjusts to RTT Short RTT send frequently at low efficiency Long RTT send less frequently at greater efficiency
Solution:
Solution:
Receiver does not advertize window until window is at least of receiver buffer or maximum segment size Transmitter refrains from sending small segments
If single TCP process occupies pipe, then required advertised window size is
RTT x Bit rate = 3 Mbytes Normal maximum window size is 65535 bytes
TIME_WAIT state
When TCP receives ACK to last FIN, TCP enters TIME_WAIT state
Protects future incarnations of connection from delayed segments TIME_WAIT = 2 x MSL Only valid segment that can arrive while in TIME_WAIT state is FIN retransmission
If such segment arrives, resent ACK & restart TIME_WAIT timer
When timer expires, close TCP connection & delete connection record
ESTABLISHED
LAST_ACK
FIN_WAIT_2
TIME_WAIT
TIME_WAIT
Receive FIN, Send ACK
SYN_SENT
Receive SYN & ACK, Send ACK
FIN_WAIT_2
ESTABLISHED
Send FIN
FIN_WAIT_1
LAST_ACK
Send FIN
LISTEN
Receive SYN Send SYN & ACK
CLOSE_WAIT
SYN_RCVD
Receive ACK, send nothing
ESTABLISHED
Router
Packet flows from many sources R bps
Congestion occurs when total arrival rate from all packet flows exceeds R over a sustained period of time Buffers at multiplexer will fill and packets will be lost
1. Light traffic
Arrival Rate Arrival Rate << R Low delay Can accommodate more Arrival rate approaches R Delay increases rapidly Throughput begins to saturate
Delay (sec)
3. Congestion collapse
Arrival rate > R Large delays, packet loss Useful application throughput drops
Arrival Rate
TCP sender maintains a congestion window cwnd to control congestion at intermediate routers Effective window is minimum of congestion window and advertised window Problem: source does not know what its fair share of available bandwidth should be Solution: adapt dynamically to available BW
Sources probe the network by increasing cwnd When congestion detected, sources reduce rate Ideally, sources sending rate stabilizes near ideal point
Congestion Window
How does the TCP congestion algorithm change congestion window dynamically according to the most up-to-date state of the network? At light traffic: each segment is ACKed quickly
Increase cwnd aggresively
At congestion: segments encounter large delays (so retransmission timeouts occur); segments are dropped in router buffers (resulting in duplicate ACKs)
Reduce transmission rate, then probe again
4
2 1
ACK
RTTs
threshold
4 2 1
RTTs
10 Slow start 5
0 Round-trip times
Congestion is detected upon timeout or receipt of duplicate ACKs Assume current cwnd corresponds to available bandwidth Adjust congestion threshold = x current cwnd Reset cwnd to 1 Go back to slow-start Over several cycles expect to converge to congestion threshold equal to about the available bandwidth
10 Slow start 5
0 Round-trip times
Measure RTT each time ACK received: tn tRTT(new) = a tRTT(old) + (1 a) tn a = 7/8 typical
RTT Variability
Estimate variance s2 of RTT variation Estimate for timeout: tout = tRTT + k sRTT If RTT highly variable, timeout increase accordingly If RTT nearly constant, timeout close to RTT estimate Approximate estimation of deviation dRTT(new) = b dRTT(old) + (1-b) | tn - tRTT | tout = tRTT + 4 dRTT