Xiaowei Yang xwy@cs.duke.edu CS 356: Computer Network Architectures Lecture 15: IP address exhaustion and End-to-end Protocols Chapter 4.1, 5.1 Xiaowei.

Slides:



Advertisements
Similar presentations
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Advertisements

CCNA – Network Fundamentals
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 OSI Transport Layer Network Fundamentals – Chapter 4.
Transmission Control Protocol (TCP)
Intermediate TCP/IP TCP Operation.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
CSE551: Computer Network Review r Network Layers r TCP/UDP r IP.
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
1 Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Chapter 5 End-to-End Protocols Copyright © 2010, Elsevier Inc. All rights.
1 CS 4396 Computer Networks Lab Transmission Control Protocol (TCP) Part I.
1 Chapter 3 TCP and IP. Chapter 3 TCP and IP 2 Introduction Transmission Control Protocol (TCP) Transmission Control Protocol (TCP) User Datagram Protocol.
1 Transport Protocols Relates to Lab 5. UDP and TCP.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
CPSC 441: Intro, UDP1 Transport Layer Instructor: Carey Williamson Office: ICT Class Location:
TCP© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
IP-UDP-RTP Computer Networking (In Chap 3, 4, 7) 건국대학교 인터넷미디어공학부 임 창 훈.
Gursharan Singh Tatla Transport Layer 16-May
Process-to-Process Delivery:
1 Transport Layer Computer Networks. 2 Where are we?
Review: –What is AS? –What is the routing algorithm in BGP? –How does it work? –Where is “policy” reflected in BGP (policy based routing)? –Give examples.
1 Chapter 1 OSI Architecture The OSI 7-layer Model OSI – Open Systems Interconnection.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 All.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
University of the Western Cape Chapter 12: The Transport Layer.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
1 Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Fall 2005 By: H. Veisi Computer networks course Olum-fonoon Babol Chapter 6 The Transport Layer.
The Transport Layer application transport network data link physical application transport network data link physical application transport network data.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
Transport Layer 3-1 Chapter 3 Outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP.
Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
1 Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
© Jörg Liebeherr (modified by Malathi Veeraraghavan) 1 Overview Formats, Data Transfer, etc. Connection Management.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
Data Communications and Networks Chapter 6 – IP, UDP and TCP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
2: Transport Layer 11 Transport Layer 1. 2: Transport Layer 12 Part 2: Transport Layer Chapter goals: r understand principles behind transport layer services:
1 Transmission Control Protocol (TCP) RFC: Introduction The TCP is intended to provide a reliable process-to-process communication service in a.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
5. End-to-end protocols (part 1)
Process-to-Process Delivery, TCP and UDP protocols
TCP.
PART 5 Transport Layer Computer Networks.
TCP Transport layer Er. Vikram Dhiman LPU.
TCP - Part I Karim El Defrawy
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Process-to-Process Delivery:
Transport Protocols An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Chapter 5 Transport Layer Introduction
PART 5 Transport Layer.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Chapter 5 Transport Layer Introduction
Introduction to Computer Networks
Lecture 21 and 22 5/29/2019.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Process-to-Process Delivery: UDP, TCP
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Layer 9/22/2019.
Presentation transcript:

Xiaowei Yang xwy@cs.duke.edu CS 356: Computer Network Architectures Lecture 15: IP address exhaustion and End-to-end Protocols Chapter 4.1, 5.1 Xiaowei Yang xwy@cs.duke.edu

Today IP address exhaustion: problem and solutions IPv6 Network Address Translation (NAT) End-to-end protocols Turn the host-to-host delivery service into a process to process communication channel UDP and TCP

IPv4 Addresses are running out

Solutions IPv6: longer addresses Network Address Translation Not all hosts have global unique addresses

IPv6 - IP Version 6 IP Version 6 Designed to be the successor to the currently used IPv4 Specification completed in 1994 Makes improvements to IPv4 (no revolutionary changes) One (not the only!) feature of IPv6 is a significant increase the address length to 128 bits (16 bytes)

IPv6 vs. IPv4: Address Comparison IPv4 has a maximum of 232  4 billion addresses IPv6 has a maximum of 2128 = (232)4  4 billion x 4 billion x 4 billion x 4 billion IPv6 will solve – for the foreseeable future – the address depletion problem of IPv4 1024 addresses per square inch on the surface of the Earth.

IPv4 and IPv6 headers IPv6: 40 bytes

Extension headers No options EHs must appear in a defined order Options: inefficient. A router must parse all fields to find relevant ones. NextHeader in a defined order. Routers can quickly find the relevant ones. Unlimited length No options EHs must appear in a defined order

Notation of IPv6 addresses Convention: The 128-bit IPv6 address is written as eight 16-bit integers (using hexadecimal digits for each integer) CEDF:BP76:3245:4464:FACE:2E50:3025:DF12 Short notations: Abbreviations of leading zeroes: CEDF:BP76:0000:0000:009E:0000:3025:DF12  CEDF:BP76:0:0:9E :0:3025:DF12 “:0000:0000:0000” can be written as “::” CEDF:BP76:0:0:FACE:0:3025:DF12  CEDF:BP76::FACE:0:3025:DF12

IPv6 Addresses with Embedded IPv4 Addresses X:X:X:X:X:X:D.D.D.D IPv4-compatible IPv6 addresses derived from IPv4 addresses have 96 leading zero bits. An IPv4/v6 host uses this address when no IPv6 router’s available ::80:8F:89:90  ::128.143.137.144 "IPv4-mapped IPv6 address ::FFFF:128.143.137.144 This address is used to represent the addresses of IPv4-only nodes (those that *do not* support IPv6) as IPv6 addresses.

IPv6 deployment status Slow, after 20+ years’ of efforts

Network Address Translation

Basic operations of NAT H1 private address: 10.0.1.2 public address: 128.143.71.21 H5 Private network Internet Source = 10.0.1.2 Destination = 213.168.112.3 = 128.143.71.21 public address: 213.168.112.3 NAT device = 213.168.112.3 = 128.143.71.21 Address Public 10.0.1.2 128.143.71.21 A NAT device has an address translation table

Private Network Private IP network is an IP network that is not directly connected to the Internet IP addresses in a private network can be assigned arbitrarily Not registered and not guaranteed to be globally unique Public IP address are assigned via Internet registries Generally, private networks use addresses from the following experimental address ranges (non-routable addresses): 10.0.0.0 – 10.255.255.255 172.16.0.0 – 172.31.255.255 192.168.0.0 – 192.168.255.255

Pooling of IP addresses Can use any IP address. 128.143.71..21

IP masquerading Also called: Network address and port translation (NAPT), port address translation (PAT). Scenario: Single public IP address is mapped to multiple hosts in a private network. NAT solution: Assign private addresses to the hosts of the corporate network NAT device modifies the port numbers for outgoing traffic

IP masquerading H1 Private network NAT device H2 Internet private address: 10.0.1.2 Private network Source = 10.0.1.2 Source port = 2001 = 128.143.71.21 = 2100 NAT device Private Address Public 10.0.1.2/2001 128.143.71.21/2100 10.0.1.3/3020 128.143.71.21/4444 H2 private address: 10.0.1.3 = 10.0.1.3 = 3020 Internet = 4444 128.143.71.21

Remarks on NAT Many complications, “a dirty hack” Widely used A host’s IP address is no longer unique Can’t use an IP address in the payload Heavyweight Need recompute TCP checksum that includes payload Widely used In practice, few cares about architecture purity Users and application developers can adapt Performance issues are not critical

Transport protocols

Before: How to deliver packet from one host to another Direct link Encoding, framing, error detection, reliability Multi-access control Multi-link network switching and forwarding Datagrams, virtual circuit Bridges, spanning tree algorithm Interconnecting multiple networks IP addressing, forwarding, routing ARP, distance vector, link state, path vector Multicast and anycast NAT, DHCP, VPN, tunnels etc.

Transport layer design goals Goal: a process to process communication channel Upper-layer: application Lower-layer: network

Desirable features Reliable delivery In-order No duplication Arbitrarily large messages Multiple processes on the same host Connection setup Not to send faster than a receiver can receive Not to send faster than the network allows Security …

Network service model Best-effort Discard, reorder, duplicate messages MTU limits Arbitrarily long latency

Design choices How to achieve the desired process-to-process service model? Let applications handle it Develop a set of libraries Enhance the network to provide the desirable features Not considered a good idea Place a service layer on top of IP to handle it This is chosen by the Internet design

Big picture We move one layer up and look at the transport layer.

Transport layer protocols are end-to-end protocols Browser Web server Router

Transport Protocols in the Internet The most commonly used transport protocols are UDP and TCP. UDP - User Datagram Protocol datagram oriented unreliable, connectionless simple unicast and multicast useful only for few applications, e.g., multimedia applications used by many services network management (SNMP), routing (RIP), naming (DNS), etc. TCP - Transmission Control Protocol byte stream oriented reliable, connection-oriented complex only unicast used for most Internet applications: web (http), email (smtp), file transfer (ftp), terminal (telnet), etc.

UDP - User Datagram Protocol UDP supports unreliable transmissions of datagrams Each output operation by a process produces exactly one UDP datagram The only thing that UDP adds is multiplexing and demultiplexing Support multiple processes on the same host Protocol number: 17

UDP Format Port numbers (16-bit) identify sending and receiving applications (processes). Maximum port number is 216-1= 65,535 Message Length (16-bit) is at least 8 bytes (I.e., Data field can be empty) and at most 65,535 Checksum (16-bit) includes UDP header and data, and a pseudo-header (protocol number, IP source/dst) (optional IPv4, mandatory IPv6)

Port Numbers UDP (and TCP) use port numbers to identify applications A globally unique address at the transport layer (for both UDP and TCP) is a tuple <IP address, port number> There are 65,535 UDP ports per host.

How to find out application ports Servers use well-known ports DNS: 53 /etc/services A server learns a client’s port from its packets

Implementation A “port” is an abstraction Implementation may differ from OS to OS Ex: port implemented using a message queue Packets discarded when queues are full

Applications Domain Name Service Streaming applications DHCP Real-time Transport protocol (RTP), RTCP Transport on transport DHCP Traceroute Simple Network Management Protocol (SNMP)

Transport Control Protocol (TCP) -- perhaps the most widely used protocol

Overview TCP = Transmission Control Protocol Connection-oriented protocol Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.

Unique design challenges We’ve learned how to reliably transmit over a direct link Coding/encoding, framing, sliding window What’s new? Process-to-process communication  connection setup Heterogeneity Bandwidth varies: how fast should the sender send? RTT varies: when should a sender time out? Out of order Resource sharing Many senders share a link in the middle of the network A logic connection between two processes Need an explicit connection setup/teardown scheme to make sure both ends are ready Greater heterogeneity RTT may range from 1ms to 100ms How to set retransmission timeout values? Link bandwidth varies How fast should a sender sends? How to set window size? Message re-order Not possible over a physical link A packet may be arbitrarily delayed Use a Maximum Segment Lifetime to discard old messages

A strawman design Hop-by-hop reliable transmission A bad idea Can’t ensure end-to-end reliability The end-to-end argument: a function should not be provided at the lower levels of a system unless it can be completely and correctly implemented at that level

TCP features Connection-oriented Reliable, in-order byte stream service Fully duplex Flow control: not to overrun a receiver Congestion control: not to congest the network

TCP manages a byte stream

TCP Segment format TCP segments have a 20 byte header with >= 0 bytes of data.

TCP header fields Port Number: multiplexing/demultiplexing A port number identifies the endpoint of a connection. A pair <IP address, port number> identifies one endpoint of a connection. Two pairs <client IP address, client port number> and <server IP address, server port number> identify a TCP connection.

TCP header fields Sequence Number (SeqNo): Sequence number is 32 bits long. So the range of SeqNo is 0 <= SeqNo <= 232 -1  4.3 Gbyte The sequence number in a segment identifies the first byte in the segment Initial Sequence Number (ISN) of a connection is set during connection establishment

TCP header fields Acknowledgement Number (AckNo): Acknowledgements are piggybacked The AckNo contains the next SeqNo that a host is expecting ACK is cumulative

TCP header fields AdvertisedWindow: Used to implement flow control Each side of the connection advertises the window size Window size is the maximum number of bytes that a receiver can accept Maximum window size is 216-1= 65535 bytes Problematic for high-speed links

A simplified TCP process

TCP header fields Header Length ( 4bits): Reserved: 6 bits Length of header in 32-bit words Note that TCP header has variable length (with minimum 20 bytes) Question: what’s the maximum header length? Reserved: 6 bits Must be zero

TCP header fields Flag bits: (from left to right) URG: Urgent pointer is valid If the bit is set, the following bytes contain an urgent message in the range: SeqNo <= urgent message < SeqNo+urgent pointer ACK: Acknowledgement Number is valid Segment contains a valid ACK PSH: PUSH Flag Notification from sender to the receiver that the receiver should pass all data that it has to the application. Normally set by sender when the sender’s buffer is empty

TCP header fields Flag bits: RST: Reset the connection The flag causes the receiver to reset the connection Receiver of a RST terminates the connection and indicates higher layer application about the reset (Real life usage: ISP uses RST to block P2P traffic) SYN: Synchronize sequence numbers Sent in the first packet when initiating a connection FIN: Sender is finished with sending Used for closing a connection Both sides of a connection must send a FIN

TCP header fields TCP Checksum: Urgent Pointer: TCP checksum covers over both TCP header and TCP data, and a pseudo-header (see next slide) Urgent Pointer: Only valid if URG flag is set

Pseudo-header 32-bit source IP 32-bit dst IP proto zero TCP len Make sure IP does not make a mistake and delivers a wrong packet to the TCP module TCP length The length of the TCP segment, including both header and data. Note that this is not a specific field in the TCP header; it is computed. If TCP length is odd, one pad byte of zero will be added to the end for a 16-bit checksum computation

Connection Management in TCP Opening a TCP Connection Closing a TCP Connection State Diagram

TCP Connection Establishment TCP uses a three-way handshake to open a connection: (1) ACTIVE OPEN: Client sends a segment with SYN bit set * port number of client initial sequence number (ISN) of client (2) PASSIVE OPEN: Server responds with a segment with initial sequence number of server ACK for ISN of client (3) Client acknowledges by sending a segment with: ACK ISN of server (* counts as one byte)

A Closer Look with tcpdump 1 aida.poly.edu.1121 > mng.poly.edu.telnet: S 1031880193:1031880193(0) win 16384 <mss 1460,nop,wscale 0,nop,nop,timestamp> 2 mng.poly.edu.telnet > aida.poly.edu.1121: S 172488586:172488586(0) ack 1031880194 win 8760 <mss 1460> 3 aida.poly.edu.1121 > mng.poly.edu.telnet: . ack 172488587 win 17520 4 aida.poly.edu.1121 > mng.poly.edu.telnet: P 1031880194:1031880218(24) ack 172488587 win 17520 5 mng.poly.edu.telnet > aida.poly.edu.1121: P 172488587:172488590(3) ack 1031880218 win 8736 6 aida.poly.edu.1121 > mng.poly.edu.telnet: P 1031880218:1031880221(3) ack 172488590 win 17520

Three-Way Handshake

TCP Connection Termination Each end of the data flow must be shut down independently (“half-close”) If one end is done it sends a FIN segment. The other end sends ACK. Four messages to completely shut down a connection FIN B A B can still send to A Active close ACK Four steps involved: (1) X sends a FIN to Y (active close) (2) Y ACKs the FIN, (at this time: Y can still send data to X) (3) and Y sends a FIN to X (passive close) (4) X ACKs the FIN. Passive close FIN ACK

Connection termination with tcpdump 1 mng.poly.edu.telnet > aida.poly.edu.1121: F 172488734:172488734(0) ack 1031880221 win 8733 2 aida.poly.edu.1121 > mng.poly.edu.telnet: . ack 172488735 win 17484 3 aida.poly.edu.1121 > mng.poly.edu.telnet: F 1031880221:1031880221(0) ack 172488735 win 17520 4 mng.poly.edu.telnet > aida.poly.edu.1121: . ack 1031880222 win 8733

TCP Connection Termination

Two events trigger transitions: Packet arrival Application operations Half-close end may still receive data Time_Wait Must wait because ACK may be lost The other end may retransmit FIN TCP state diagram Each square denotes a state. Each arc is a transition labeled with the event that triggers the transition. Half close: one end may close and the other end can still send

Connection establishment/tear down Active/passive open Active/passive close, simultaneous close

TCP States in “Normal” Connection Lifetime

2MSL Wait State 2MSL= 2 * Maximum Segment Lifetime 2MSL Wait State = TIME_WAIT When TCP does an active close, and sends the final ACK, the connection must stay in the TIME_WAIT state for twice the maximum segment lifetime. The socket pair (srcIP, srcPort, dstIP, dstPort) cannot be reused Why? To prevent mixing packets from two different incarnations of the same connection FIN B A TCP is given a chance to resent the final ACK. (Server will timeout after sending the FIN segment and resend the FIN) Without waiting, FIN may close a wrong connection The MSL is set to 2 minutes or 1 minute or 30 seconds. ACK FIN X ACK

Resetting Connections Resetting connections is done by setting the RST flag When is the RST flag set? Connection request arrives and no server process is waiting on the destination port Abort a connection causes the receiver to throw away buffered data Receiver does not acknowledge the RST segment Abused in practice to block applications

Summary IP address exhaustion TCP Next: continue on TCP IPv6 Network address translation TCP Segment format Connection establish and termination Next: continue on TCP

IPv6 Addressing architecture Unicast: An identifier for a single interface. A packet sent to a unicast address is delivered to the interface identified by that address. Anycast: An identifier for a set of interfaces (typically belonging to different nodes). A packet sent to an anycast address is delivered to one of the interfaces identified by that address (the "nearest" one, according to the routing protocols' measure of distance). Multicast: An identifier for a set of interfaces (typically belonging to different nodes). A packet sent to a multicast address is delivered to all interfaces identified by that address. Reserved RFC 2373: IP Version 6 Addressing Architecture

IPv6 address allocation Allocation Prefix Fraction of (binary) Address Space Reserved 0000 0000 1/256 Unassigned 0000 0001 Reserved for NSAP Allocation 0000 001 1/128 Reserved for IPX Allocation 0000 010 0000 011 0000 1 1/32 0001 1/16 Aggregatable Global Unicast Addresses 001 1/8 A Network Service Access Point (NSAP) addresses, defined in ISO/IEC 8348, are identifying labels for network endpoints used in OSI networking. These are roughly comparable to IP addresses used in the IP protocol; they can specify a piece of equipment connected to the ATM network. IPX address are identifying peering points. IPX is a connectionless layer 3 protocol like IP. An IPX address is made up of 32 bits network and 48 bits MAC address (80 bits in total). It is important you know the length of these in binary and hexadecimal.

Link-Local Unicast Addresses 1111 1110 10 1/1024 Site-Local Unicast Addresses 1111 1110 11 Multicast Addresses 1111 1111 1/256 Unassigned 010 1/8 011 100 101 110 1110 1/16 1111 0 1/32 1111 10 1/64 1111 110 1/128 1111 1110 0 1/512

TCP header fields Options: (Type, length, value)

TCP header fields Options: NOP is used to pad TCP header to multiples of 4 bytes Maximum Segment Size Window Scale Options Increases the TCP window from 16 to 32 bits, i.e., the window size is interpreted differently This option can only be used in the SYN segment (first segment) during connection establishment time Timestamp Option Can be used for roundtrip measurements