View
233
Download
1
Category
Preview:
Citation preview
1
Chapter 3Chapter 3
TCP and IPTCP and IP
Chapter 3 TCP and IP2
Introduction Introduction
Transmission Control Protocol Transmission Control Protocol (TCP)(TCP)
User Datagram Protocol (UDP)User Datagram Protocol (UDP) Internet Protocol (IPv4)Internet Protocol (IPv4) IPv6IPv6
Chapter 3 TCP and IP3
TCPTCPDefined in Defined in RFC 793RFC 793, RFC 1122, RFC 1122Provides the Internet’s primary Provides the Internet’s primary
reliable host-to-host delivery reliable host-to-host delivery mechanismmechanism
Services offered:Services offered:– basic data transferbasic data transfer– reliability (reliable data transfer)reliability (reliable data transfer)– flow controlflow control– multiplexing/de-multiplexingmultiplexing/de-multiplexing– connections (maintains state)connections (maintains state)– precedence and securityprecedence and security
Chapter 3 TCP and IP4
TCP HeaderTCP Header
Chapter 3 TCP and IP5
TCP Fields/FunctionsTCP Fields/Functions Source Port # (16 bits):Source Port # (16 bits): source source
application (application (multiplexingmultiplexing)) Destination Port # (16 bits):Destination Port # (16 bits): target target
application (application (de-multiplexingde-multiplexing)) Sequence # (32 bits):Sequence # (32 bits): number of the number of the
first data octet (first data octet (reliable data transferreliable data transfer)) Acknowledgement # (32 bits):Acknowledgement # (32 bits): next next
data octet expected by receiver data octet expected by receiver ((reliable data transferreliable data transfer))
Data offset/header length (4 bits):Data offset/header length (4 bits): number of 32bit words in the header number of 32bit words in the header ((basic data transferbasic data transfer))
Chapter 3 TCP and IP6
TCP Fields/FunctionsTCP Fields/Functions Flags (6 or 8 bits):Flags (6 or 8 bits): source application source application
((precedence, connection managementprecedence, connection management)) Window size (16 bits):Window size (16 bits): number data number data
octets receiver is willing to accept (octets receiver is willing to accept (flow flow controlcontrol))
Checksum (16 bits):Checksum (16 bits): error detection error detection code (code (reliable data transferreliable data transfer))
Urgent pointer (16 bits):Urgent pointer (16 bits): pointer to last pointer to last data octet in sequence of urgent data data octet in sequence of urgent data (precedence)(precedence)
Header length (variable):Header length (variable): number of number of 32bit words in the header – indicates 32bit words in the header – indicates presence or absence of options (presence or absence of options (variousvarious))
more ->more ->
more ->more ->
more ->more ->
more ->more ->
Chapter 3 TCP and IP7
TCP Fields/Functions (Flags)TCP Fields/Functions (Flags) URG:URG: urgent pointer field is significant urgent pointer field is significant ACK:ACK: acknowledgement field is significant acknowledgement field is significant PSH:PSH: push function specified by app push function specified by app RST:RST: reset the connection reset the connection SYN:SYN: synchronize the sequence number synchronize the sequence number FIN: FIN: no more data from senderno more data from sender
CWR:CWR: congestion warning congestion warning
acknowledgement acknowledgement ECE: ECE: Explicit congestion notificationExplicit congestion notification
more ->more ->
more ->more ->
RFC RFC 31683168
Chapter 3 TCP and IP8
TCP Data FlowTCP Data Flow
Outgoing data is logically a stream Outgoing data is logically a stream of octets from an end user (SEND)of octets from an end user (SEND)
Stream is broken into blocks of Stream is broken into blocks of data, called segmentsdata, called segments
TCP accumulates octets from user TCP accumulates octets from user until segment is large enough, or until segment is large enough, or data is marked with PUSH flagdata is marked with PUSH flag
User (i.e. the application) can mark User (i.e. the application) can mark data as URGENTdata as URGENT
Chapter 3 TCP and IP9
Similarly, incoming data is a Similarly, incoming data is a stream of octets presented to stream of octets presented to user (application)user (application)
Data marked with PUSH flag Data marked with PUSH flag triggers delivery of data to user, triggers delivery of data to user, otherwise TCP decides when to otherwise TCP decides when to deliver data (RECEIVE)deliver data (RECEIVE)
Data marked with URGENT flag Data marked with URGENT flag causes user to be signaledcauses user to be signaled
TCP Data Flow (cont.)TCP Data Flow (cont.)
Chapter 3 TCP and IP10
OptionsOptions Maximum segment size (RFC793)Maximum segment size (RFC793)
– specifies the maximum segment size in specifies the maximum segment size in octets to be used in the connection (16 bits)octets to be used in the connection (16 bits)
– used during connection establishmentused during connection establishment Window scale factorWindow scale factor
– receiver window scale factor F (max. 14)receiver window scale factor F (max. 14)– scales receiver window size by 2scales receiver window size by 2FF
– used during connection establishmentused during connection establishment TimestampTimestamp
– used by TCP to monitor RTTused by TCP to monitor RTT– Timestamp… Timestamp Echo ReplyTimestamp… Timestamp Echo Reply
Chapter 3 TCP and IP11
UDPUDP
RFC 768RFC 768Connectionless, unreliableConnectionless, unreliableLess overheadLess overheadSimply adds port addressing to IPSimply adds port addressing to IPChecksum is optionalChecksum is optional
Chapter 3 TCP and IP12
Appropriate Uses of UDPAppropriate Uses of UDP Inward data collectionInward data collectionOutward data disseminationOutward data disseminationRequest-responseRequest-responseReal-time applicationsReal-time applicationsExamples?Examples?
DNSDNS SNMPSNMP Streaming audio/videoStreaming audio/video VoIPVoIP RIPRIP
• Timeliness/ Timeliness/ timingtiming of of data data criticalcritical
• Occasional Occasional lossloss or or significant significant delaydelay is is acceptableacceptable
Chapter 3 TCP and IP13
IPIPDefined in RFC 791Defined in RFC 791
Chapter 3 TCP and IP14
IPv4 Address ClassesIPv4 Address Classes
Chapter 3 TCP and IP17
IPv6IPv6
Increase IP address from 32 bits Increase IP address from 32 bits to 128 bitsto 128 bits
Accommodate higher network Accommodate higher network speeds, mix of data streams speeds, mix of data streams (graphics, video, audio)(graphics, video, audio)
Fixed size 40-octet header for Fixed size 40-octet header for performance, followed by optional performance, followed by optional extension headersextension headers
Longer header but fewer fields (8 Longer header but fewer fields (8 vs 12), so routers should have vs 12), so routers should have less processingless processing
Chapter 3 TCP and IP18
IPv6 HeaderIPv6 Header
Chapter 3 TCP and IP19
IPv6 HeaderIPv6 Header VersionVersion: 6: 6 Traffic classTraffic class: e.g. DSCP (more later): e.g. DSCP (more later) Flow labelFlow label: identifies packets in a sequence : identifies packets in a sequence
from a particular source to destination that from a particular source to destination that need special handling (more later)need special handling (more later)
Payload lengthPayload length: total length of packet in : total length of packet in octets, minus 40 octets (max 65535)octets, minus 40 octets (max 65535)
Next headerNext header: specifies how to interpret next : specifies how to interpret next field following the headerfield following the header
Hop limitHop limit: max number of hops for this : max number of hops for this packet, decremented field, discard at 0 packet, decremented field, discard at 0
Source addressSource address: packet originator: packet originator Destination addressDestination address: intended recipient: intended recipient
Chapter 3 TCP and IP20
IPv6 AddressesIPv6 Addresses128 bits128 bitsLonger addresses can have Longer addresses can have
structure that assists routingstructure that assists routing3 types:3 types:
– UnicastUnicast: single address for a : single address for a single single interfaceinterface
– AnycastAnycast: aggregate address for : aggregate address for any any one of a related setone of a related set of interfaces of interfaces
– MulticastMulticast: single address for : single address for all of a all of a groupgroup of interfaces of interfaces
Chapter 3 TCP and IP21
IPv6 Packet & Extension IPv6 Packet & Extension HeadersHeaders
Chapter 3 TCP and IP22
Optional Extension HeadersOptional Extension HeadersHop-by-hop optionsHop-by-hop options: : instructions for instructions for
each router (RFCs 2675 and 2711)each router (RFCs 2675 and 2711)RoutingRouting: : explicit list of intermediate explicit list of intermediate
nodesnodesFragmentFragment: : only at source nodesonly at source nodesAuthenticationAuthentication: : (IPsec) packet integrity (IPsec) packet integrity
and authenticationand authenticationEncapsulating security payloadEncapsulating security payload: :
(IPsec) payload privacy(IPsec) payload privacyDestination optionsDestination options: : examined only examined only
by destination nodeby destination node
Chapter 3 TCP and IP23
IPv6 Extension HeadersIPv6 Extension Headers
Recommended