Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

8 congestion-ipv6

1,381 views

Published on

Computer networks, 8th week : congestion control sctp, tcp tuning, ipv6

Published in: Engineering
  • Be the first to comment

8 congestion-ipv6

  1. 1. Week 8 SCTP and Internet Congestion control IPv6
  2. 2. Agenda • Congestion control • AIMD in TCP • Explicit Congestion Notification • SCTP • Principles • Differences with TCP • IPv6
  3. 3. TCP with mild congestion Cwnd Fast retransmit Threshold Fast retransmit Threshold Slow-start exponential increase of cwnd Congestion avoidance linear increase of cwnd
  4. 4. Severe congestion Cwnd Time Timer expiration Threshold Timer expiration Threshold Slow-start exponential increase of cwnd Congestion avoidance linear increase of cwnd
  5. 5. AIMD in TCP # Initialisation cwnd = MSS; ssthresh= swin; # Ack arrival if tcp.ack > snd.una : # new ack, no congestion if cwnd < ssthresh : # slow-start : increase quickly cwnd # double cwnd every rtt cwnd = cwnd + MSS else: # congestion avoidance : increase slowly cwnd # increase cwnd by one mss every rtt cwnd = cwnd+ mss*(mss/cwnd)
  6. 6. AIMD in TCP else: # duplicate or old ack if tcp.ack==snd.una: # duplicate acknowledgement dupacks++ if dupacks==3: retransmitsegment(snd.una) ssthresh=max(cwnd/2,2*MSS) cwnd=ssthresh else: dupacks=0 # ack for old segment, ignored Expiration of the retransmission timer: send(snd.una) # retransmit first lost segment sshtresh=max(cwnd/2,2*MSS) cwnd=MSS
  7. 7. Examples • Time to transmit 6 TCP segments without losses • Time to transmit 6 TCP segments if 3rd is lost • Time to transmit 10 TCP segments if 5th is lost
  8. 8. Simplified model • Assume all segment losses are periodic and the every 1/p segment is lost Cwnd(segments) W W/2 0 0 W/2 W 3W/2 Surface 2W time(rtt) It can be shown that the throughput of a TCP connection can be approximated by : Maximum throughput without losses Throughput with losses/congestion
  9. 9. Tuning TCP @google • Target • Minimize time to receive result from search engine • HTTP GET in one segment • HTTP Response in <16 KBytes
  10. 10. Initial retransmission timer • What happens if SYN or SYN+ACK is lost ?
  11. 11. Initial congestion window • What is the impact of slow-start on the time to receive an HTTP response ?
  12. 12. TCP Fast Open • Can we we reduce the overhead of the three-way handshake ? • HTTP/1.1 • Putting data inside SYN and SYN+ACK
  13. 13. TCP Fast Open SYN(Src=C,seq=x, HTTP GET) CONNECT.ind+HTTP GET CONNECT.req+Data SYN+ACK(Dest=C,ack=x+1,seq=y, HTTP Resp) ACK(Src=A,seq=x) • Is this safe ? • Risk of denial of service attack
  14. 14. Safe TCP Fast Open • How to make TCP Fast Open safe in the presence of attackers ? • Server needs to ensure that SYN segment does not come from a spoofer
  15. 15. Agenda • Congestion control • AIMD in TCP • Explicit Congestion Notification • SCTP • Principles • Differences with TCP • IPv6
  16. 16. Agenda • Congestion control • AIMD in TCP • Explicit Congestion Notification • SCTP • Principles • Differences with TCP • IPv6
  17. 17. SCTP • Segment format
  18. 18. SCTP connection establishment
  19. 19. INIT Chunk 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 1 | Chunk Flags | Chunk Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Initiate Tag | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertised Receiver Window Credit (a_rwnd) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Number of Outbound Streams | Number of Inbound Streams | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Initial TSN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / Optional/Variable-Length Parameters / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  20. 20. INIT-ACK chunk 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 2 | Chunk Flags | Chunk Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Initiate Tag | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertised Receiver Window Credit | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Number of Outbound Streams | Number of Inbound Streams | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Initial TSN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / Optional/Variable-Length Parameters / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  21. 21. COOKIEs • COOKIE-ECHO 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 10 |Chunk Flags | Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / Cookie / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ • COOKIE-ACK 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 11 |Chunk Flags | Length = 4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  22. 22. COOKIE • Variable length chunk • Which information should be placed inside the COOKIE ?
  23. 23. Verification tag • Why is this tag present in all SCTP segments ?
  24. 24. Payload chunk 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 0 | Reserved|U|B|E| Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TSN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Stream Identifier S | Stream Sequence Number n | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Payload Protocol Identifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / User Data (seq n of Stream S) / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  25. 25. SACK chunk 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 3 |Chunk Flags | Chunk Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Cumulative TSN Ack | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertised Receiver Window Credit (a_rwnd) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Number of Gap Ack Blocks = N | Number of Duplicate TSNs = X | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Gap Ack Block #1 Start | Gap Ack Block #1 End | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / / ... / / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Gap Ack Block #N Start | Gap Ack Block #N End | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Duplicate TSN 1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / / ... / / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Duplicate TSN X | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  26. 26. Dealing with messages • How to enable the receiver to reconstruct the received messages ? B E Description ============================================================ | 1 0 | First piece of a fragmented user message | +----------------------------------------------------------+ | 0 0 | Middle piece of a fragmented user message | +----------------------------------------------------------+ | 0 1 | Last piece of a fragmented user message | +----------------------------------------------------------+ | 1 1 | Unfragmented message | ============================================================ | Table 1: Fragment Description Flags | ============================================================
  27. 27. Connection release
  28. 28. SHUTDOWN chunks • SHUTDOWN 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 7 | Chunk Flags | Length = 8 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Cumulative TSN Ack | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ • SHUTDOWN ACK 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 8 |Chunk Flags | Length = 4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  29. 29. Agenda • Congestion control • SCTP • IPv6 • Addressing architecture • Packets • ICMPv6
  30. 30. IPv6 addresses • Each IPv6 address is encoded in 128 bits • 3.4 x 10^38 possible addressable devices • 6.65 x 10^23 addresses per square meter • Why 128 bits ? IPv4 IP version 6
  31. 31. Addressing architecture • Three types of IPv6 addresses • Unicast addresses • An identifier for a single interface. A packet sent to a unicast address is delivered to the interface identified by that address • Anycast addresses • An identifier for a set of interfaces. • Multicast addresses • An identifier for a set of interfaces. A packet sent to a multicast address is delivered to all interfaces identified by that address.
  32. 32. Textual representation • Hexadecimal format • FEDC:BA98:7654:3210:FEDC:BA98:7654: 3210 • 1080:0:0:0:8:800:200C:417A • Compact hexadecimal format • Some IPv6 addresses contain lots of zero • use "::" for one or more groups of 16 zeros. • 1080:0:0:0:8:800:200C:417A = 1080::8:800:200C:417A • FF01:0:0:0:0:0:0:101 = FF01::101
  33. 33. IPv6 unicast addresses interface ID 128 bits N bits M bits 128-N-M bits Usually 64 bits Based on MAC Address global routing prefix subnet ID Can be used to identify the ISP responsible for this address A subnet in this ISP or a customer of this ISP
  34. 34. Agenda • Congestion control • SCTP • IPv6 • Addressing architecture • Packets • ICMPv6
  35. 35. The IPv6 packet format 32 bits Ver Tclass Flow Label NxtHdr Hop Limit Payload Length Source IPv6 address (128 bits) Destination IPv6 address (128 bits) Version=6 Traffic class Size of packet content in bytes Unclear utilisation Same as TTL Used to identify the type of the next header found in the packet payload
  36. 36. Sample packets Payload Length Payload Length Sequence number Acknowledgment number THL Reserved Flags • Identification of a TCP connection Window • IPv6 src, IPv6 dest, Source and Destination ports 32 bits Ver Tclass Flow Label NxtHdr Hop Limit Source IPv6 address (128 bits) Destination IPv6 address (128 bits) Source port Destination port Length Checksum UDP 32 bits Ver Tclass Flow Label NxtHdr Hop Limit Source IPv6 address (128 bits) Destination IPv6 address (128 bits) Source port Destination port Checksum Urgent pointer TCP UDP TCP
  37. 37. Agenda • Congestion control • SCTP • IPv6 • Addressing architecture • Packets • ICMPv6
  38. 38. ICMP • Internet Control Message Protocol • Runs on top of IPv6 and provides various types of services • tools to aid debugging network problems • error reporting • autoconfiguration of addresses
  39. 39. ping6 #ping6 www.ietf.org PING6(56=40+8+8 bytes) 2001:6a8:3080:2:3403:bbf4:edae:afc3 --> 2001:1890:123a::1:1e 16 bytes from 2001:1890:123a::1:1e, icmp_seq=0 hlim=49 time=156.905 ms 16 bytes from 2001:1890:123a::1:1e, icmp_seq=1 hlim=49 time=155.618 ms 16 bytes from 2001:1890:123a::1:1e, icmp_seq=2 hlim=49 time=155.808 ms 16 bytes from 2001:1890:123a::1:1e, icmp_seq=3 hlim=49 time=155.325 ms 16 bytes from 2001:1890:123a::1:1e, icmp_seq=4 hlim=49 time=155.493 ms 16 bytes from 2001:1890:123a::1:1e, icmp_seq=5 hlim=49 time=155.801 ms 16 bytes from 2001:1890:123a::1:1e, icmp_seq=6 hlim=49 time=155.660 ms 16 bytes from 2001:1890:123a::1:1e, icmp_seq=7 hlim=49 time=155.869 ms ^C --- www.ietf.org ping6 statistics --- 8 packets transmitted, 8 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 155.325/155.810/156.905/0.447 ms
  40. 40. traceroute6 #traceroute6 www.ietf.org traceroute6 to www.ietf.org (2001:1890:1112:1::20) from 2001:6a8:3080:2:217:f2ff:fed6:65c0, 30 hops max, 12 byte packets 1 2001:6a8:3080:2::1 13.821 ms 0.301 ms 0.324 ms 2 2001:6a8:3000:8000::1 0.651 ms 0.51 ms 0.495 ms 3 10ge.cr2.bruvil.belnet.net 3.402 ms 3.34 ms 3.33 ms 4 10ge.cr2.brueve.belnet.net 3.668 ms 10ge.cr2.brueve.belnet.net 3.988 ms 10ge.cr2.brueve.belnet.net 3.699 ms 5 belnet.rt1.ams.nl.geant2.net 10.598 ms 7.214 ms 10.082 ms 6 so-7-0-0.rt2.cop.dk.geant2.net 20.19 ms 20.002 ms 20.064 ms 7 kbn-ipv6-b1.ipv6.telia.net 21.078 ms 20.868 ms 20.864 ms 8 s-ipv6-b1-link.ipv6.telia.net 31.312 ms 31.113 ms 31.411 ms 9 s-ipv6-b1-link.ipv6.telia.net 61.986 ms 61.988 ms 61.994 ms 10 2001:1890:61:8909::1 121.716 ms 121.779 ms 121.177 ms 11 2001:1890:61:9117::2 203.709 ms 203.305 ms 203.07 ms 12 mail.ietf.org 204.172 ms 203.755 ms 203.748 ms

×