210 likes | 354 Views
Chapter 3. TCP and IP. Introduction. Transmission Control Protocol (TCP) User Datagram Protocol (UDP) Internet Protocol (IPv4) IPv6. TCP. Defined in RFC 793 , RFC 1122 Provides the Internet’s primary reliable host-to-host delivery mechanism Services offered: basic data transfer
E N D
Chapter 3 TCP and IP
Introduction • Transmission Control Protocol (TCP) • User Datagram Protocol (UDP) • Internet Protocol (IPv4) • IPv6 Chapter 3 TCP and IP
TCP • Defined in RFC 793, RFC 1122 • Provides the Internet’s primary reliable host-to-host delivery mechanism • Services offered: • basic data transfer • reliability (reliable data transfer) • flow control • multiplexing/de-multiplexing • connections (maintains state) • precedence and security Chapter 3 TCP and IP
TCP Header Chapter 3 TCP and IP
TCP Fields/Functions • Source Port # (16 bits): source application (multiplexing) • Destination Port # (16 bits): target application (de-multiplexing) • Sequence # (32 bits): number of the first data octet (reliable data transfer) • Acknowledgement # (32 bits): next data octet expected by receiver (reliable data transfer) • Data offset/header length (4 bits): number of 32bit words in the header (basic data transfer) Chapter 3 TCP and IP
TCP Fields/Functions • Flags (6 or 8 bits): source application (precedence, connection management) • Window size (16 bits): number data octets receiver is willing to accept (flow control) • Checksum (16 bits): error detection code (reliable data transfer) • Urgent pointer (16 bits): pointer to last data octet in sequence of urgent data (precedence) • Header length (variable): number of 32bit words in the header – indicates presence or absence of options (various) more -> more -> more -> more -> Chapter 3 TCP and IP
TCP Fields/Functions (Flags) • URG: urgent pointer field is significant • ACK: acknowledgement field is significant • PSH: push function specified by app • RST: reset the connection • SYN: synchronize the sequence number • FIN: no more data from sender • CWR: congestion warning acknowledgement • ECE: Explicit congestion notification more -> more -> RFC 3168 Chapter 3 TCP and IP
TCP Data Flow • Outgoing data is logically a stream of octets from an end user (SEND) • Stream is broken into blocks of data, called segments • TCP accumulates octets from user until segment is large enough, or data is marked with PUSH flag • User (i.e. the application) can mark data as URGENT Chapter 3 TCP and IP
TCP Data Flow (cont.) • Similarly, incoming data is a stream of octets presented to user (application) • Data marked with PUSH flag triggers delivery of data to user, otherwise TCP decides when to deliver data (RECEIVE) • Data marked with URGENT flag causes user to be signaled Chapter 3 TCP and IP
Options • Maximum segment size (RFC793) • specifies the maximum segment size in octets to be used in the connection (16 bits) • used during connection establishment • Window scale factor • receiver window scale factor F (max. 14) • scales receiver window size by 2F • used during connection establishment • Timestamp • used by TCP to monitor RTT • Timestamp… Timestamp Echo Reply Chapter 3 TCP and IP
UDP • RFC 768 • Connectionless, unreliable • Less overhead • Simply adds port addressing to IP • Checksum is optional Chapter 3 TCP and IP
Timeliness/ timing of data critical • Occasional loss or significant delay is acceptable Appropriate Uses of UDP • Inward data collection • Outward data dissemination • Request-response • Real-time applications • Examples? • DNS • SNMP • Streaming audio/video • VoIP • RIP Chapter 3 TCP and IP
IP • Defined in RFC 791 Chapter 3 TCP and IP
IPv4 Address Classes Chapter 3 TCP and IP
IPv6 • Increase IP address from 32 bits to 128 bits • Accommodate higher network speeds, mix of data streams (graphics, video, audio) • Fixed size 40-octet header for performance, followed by optional extension headers • Longer header but fewer fields (8 vs 12), so routers should have less processing Chapter 3 TCP and IP
IPv6 Header Chapter 3 TCP and IP
IPv6 Header • Version: 6 • Traffic class: e.g. DSCP (more later) • Flow label: identifies packets in a sequence from a particular source to destination that need special handling (more later) • Payload length: total length of packet in octets, minus 40 octets (max 65535) • Next header: specifies how to interpret next field following the header • Hop limit: max number of hops for this packet, decremented field, discard at 0 • Source address: packet originator • Destination address: intended recipient Chapter 3 TCP and IP
IPv6 Addresses • 128 bits • Longer addresses can have structure that assists routing • 3 types: • Unicast: single address for a single interface • Anycast: aggregate address for any one of a related set of interfaces • Multicast: single address for all of a group of interfaces Chapter 3 TCP and IP
IPv6 Packet & Extension Headers Chapter 3 TCP and IP
Optional Extension Headers • Hop-by-hop options: instructions for each router (RFCs 2675 and 2711) • Routing: explicit list of intermediate nodes • Fragment: only at source nodes • Authentication: (IPsec) packet integrity and authentication • Encapsulating security payload: (IPsec) payload privacy • Destination options: examined only by destination node Chapter 3 TCP and IP
IPv6 Extension Headers Chapter 3 TCP and IP