340 likes | 569 Views
CS 164: Slide Set 12 IPv6 and Transport Layer . Where are we ?. We have covered Sections 4.1, 4.2 and 4.3 (We finish 4.3 today with IPv6). We now move to Chapter 5 and cover Sections 5.1 and 5.2. We will revisit Section 4.4 (Multicast), time permitting. Why IPv6 ?.
E N D
CS 164: Slide Set 12 IPv6 and Transport Layer
Where are we ? • We have covered Sections 4.1, 4.2 and 4.3 (We finish 4.3 today with IPv6). • We now move to Chapter 5 and cover Sections 5.1 and 5.2. • We will revisit Section 4.4 (Multicast), time permitting.
Why IPv6 ? • Address space is scarce -- 32 bits may not suffice. • Initial proposal to double the IP address space but finally a proposal to have 128 bit IP addresses. • Allows for 3 x 1038 addresses.
In addition ... • Support for real-time services • Better Security support • Auto configuration • Mobility support • Note that many of these exist in IPv4 but the goal is to do these things better.
Address Space Allocation • No classes; however, address space sub-divided based on leading bits. • Prefixes may have specific assignments. • There are special prefixes for “link local use” and “site local use”. Hosts can construct (by themselves) an address that will work on the network that they have without being concerned about global uniqueness. • A large fraction of the addresses are assigned as before -- for unicast operations. • However, a significant chunks of space are reserved for future use and to accommodate non-IP addresses. • Read book for rest on this.
Address Notation • It is in Hex ! • Example: 47CD:1234:4412:AC02:0022:1234:A456:1204 • If we have --47CD:0000:0000:0000:0000:0000:A456:1204 it is simply represented as : 47CD::A456:1204 -- for compact representation.
Backward Compatibility • IPv4 compatible IPv6 addresses: Zero extend the 32 bit IPv4 address to 128 bits. This is required for those nodes that understand IPv6. • IPv4 Mapped IPv6 addresses: Add a 2 byte prefix of all 1’s to the 32 bit IPv4 address and then zero extend the result. • Example ::00FF:128.96.33.81 • Note that if there are nodes that can only understand Ipv4, one could use tunneling between these nodes -- creation of IPv6 tunnels.
Routing with IPv6 • There exists global unicast addresses that can be aggregated. Similar to CIDR. • Stub AS or Multihomed AS --> subscribers. • Transit AS --> Providers. • Can be either direct providers (connected to backbone networks) or indirect providers. • The address prefix is assigned to the provider who then assigns the lower prefix to subscribers -- a single provider prefix is advertised. • The disadvantage is that changing providers can cause problems. • IPv6 packet format -- read book.
Auto-configuration • Obtain an Interface ID that is unique on the link to which the host is attached -- link layer addresses used. • Obtain correct prefix -- router periodically advertises. • Put them together.
NAT • Stands for Network address translation. • Hosts are assigned a private address --not necessarily unique. • There is a NAT box that provides the address translation --in some sense acts as a proxy. • It is complex -- need for understanding of higher layer protocols (port nos. etc. for obtaining correct mapping). • Viewed architecturally impure by purists.
Anycasts • With anycasting, packet may go to any of a set of interfaces (as an example the nearest interface). • As an example, all of the routers of a backbone provider could be assigned a single anycast address. • Web caching -- http request forwarded to any of a set of sites. • IPv6 supports anycasting -- a specific address format. • Rest of IPv6 -- Self Study.
Chapter 5: Transport Layer
Transport Layer:Intro • A single logical connection between processes. • Hides intricacies of underlying network structure. • Takes an application message, divides it into smaller chunks (called PDUs for protocol data units), adds headers and sends.
UDP • Stands for User Datagram protocol. • Acts as a simple demultiplexer between processes. • Once datagram arrives at a destination host, which process is it to be forwarded to ? • The processes are distinguished using port numbers. • Note: IP multiplexes data from various processes! • Best Effort -- as with IP. • UDP applications --DNS, routing updates.
Ports • Processes identified using port numbers -- an abstraction. • 16 bit representation of ports. • Destination port is usually well known • In Unix usually in /etc/services • as an example -- DNS has port 53 on which messages are received. • Can use well known port to agree on a different port to communicate. • Port implementation is OS specific -- usually implemented as message queues • UDP appends message to queue.
What does UDP give ? • Just demultiplexing. • No “flow control” • No reliable/ordered delivery • No congestion control provision. • But, message correctness ensured by checksum.
UDP checksum • Computed over the UDP header, the contents of the message body and something called the pseudoheader. • Pseudoheader -- from IP header, contains protocol number, source IP address, destination IP address and UDP length field. • Arrange the contents into 16 bit words, add the words, take the 1’s complement and include as checksum.
Why UDP ? • No connection set up. • No need to maintain state. • Smaller packet overhead (8 bytes whereas TCP has 20 bytes) • Unregulated send rate -- especially if packet loss is not an issue.
Transmission Control Protocol (TCP) • Reliable byte stream. • Connection oriented --> • Guarantees reliable in-order delivery of a stream of bytes. • Has flow control i.e., the receiver can limit the amount of data that the source sends. • Does the demultiplexing that UDP does. • Includes a congestion control mechanism -- throttle the rate of sending to avoid overloading the network.
TCP basics • A sliding window protocol is at the heart of TCP. • TCP establishes an explicit logical connection between a client and a server. • There is an explicit connection establishment phase (similar to dialing a connection) -- the two sides agree to exchange data. • The two parties establish some shared state to enable the sliding window algorithm to begin. • There is a explicit teardown phase -- the connection is torn down.
Challenges • Remember, sliding window specifies how many segments should be in flight at a given time. • The RTT of a logical connection is highly variable. • Delay bandwidth product okay only if there is a single connection -- however, if there are many connections, and the number is varying on the different links through which a TCP connection passes,estimation of this product is difficult. • TCP tries to learn about the resources for a connection.
Packet re-ordering and Sequence Nos. • Packets could be re-ordered when the traverse the Internet. • Sequence numbers are used to ensure that they arrive in order. • How far out of order ? (to be determined) • Remember -- IP has a TTL • TCP uses this information to define a maximum segment lifetime (defined as MSL). • Current recommended setting for MSL is 120 seconds (it is a conservative estimate).
Segments • TCP is a byte oriented protocol -- This means that sender writes “bytes” into a TCP connection and receiver retrieves bytes. • But TCP does not really “directly” transmit bytes. • Buffers enough to fill a reasonably sized data unit called segment and sends it to receiver. • Receiver retrieves bytes and stores in buffer.
Application process Application process Write Read bytes bytes TCP TCP Send buffer Receive buffer ■ ■ ■ Segment Segment Segment Transmit segments Pictorial View of the Process
Maximum Segment Size • TCP segment size is limited by what is called MSS (Maximum Segment Size). • The largest segment that TCP can send without causing the local IP layer to fragment it.
The Push Operation • One can also invoke the push operation with TCP. • Flushes the buffer of unsent bytes • supports the operation of terminal emulators (such as talk or chat). • With Push, there is a timer that periodically fires taking what is in the buffer.
TCP Segment Format • Src Port and Dst Port represent the corresponding port nos. • TCP’s demux key is {Src Port, Src IP addr, Dst Port, Dst IP addr} • Each byte of data contains a sequence number. • Sequence number of segment is the sequence number of first byte.
ACK and Advertised Window go from receiver to sender (we will see later). Hdr Len -- In terms of 32 bit words. Checksum is over TCP header, TCP data and pseudoheader (as in UDP). TCP Segment (cont) • Options -- Time stamps, extension of the adv. window
Flags in TCP header • There are 6 bits for flags. • SYN flag -- connection establishment • FIN flag -- connection termination • ACK flag -- Acknowledgement field is valid -- bytes are being acknowledged, so the receiving TCP entity should pay attention to that field. • URG flag --segment contains urgent data (next slide). • PUSH flag -- sender invoked PUSH -- send data to application right away. • RESET flag : confusion -- abort connection.
Urgent data • Data to interrupt operation underway • called out of band communications. • The Urgent flag says that there is urgent data in the front of the segment body upto what is specified by the UrgPtr field.
Active participant (client) (server) SYN, SequenceNum = x SYN+ACK, SequenceNum=y, Acknowledgment =x+1 ACK, Acknowledgment =y+1 Connection Establishment • Client is the caller • Server is the callee • In the SYN+ACK message, both the SYN and ACK flags are set. • It is a three way handshake!
The Three Way Handshake • If SYN+ACK is lost, then server is left hanging -- does not know that the client did not get it and therefore might have aborted. • If ACK gets lost on the other hand, it is ok -- the sender sends the first segment and so on -- so the connection survives.
Next Time • Connection Termination • TCP State Transition Diagram • What is the Advertised Window ? -- Flow Control.