CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.

Post on 16-Dec-2015

221 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

Transcript

CS3505 CS3505 The Internet and Info The Internet and Info

HiwayHiwaytransport layer protocols : transport layer protocols :

TCP/UDPTCP/UDP

transport layer : purpose transport layer : purpose

provides and end-to-end (host to host) data transfer service to its “customers” : applications (e-mail, FTP, Telnet, HTTP, telephony)

interface between network/internet (e.g., IP) and the applications

--TCP and UDP are the major TPs in use today, and these operate over IP

TCP/IP internet TCP/IP internet

WAN

IP

WAN

IP

IP

IP ...TCP/IP

TCP/IP

TCP/IP

protocol hierarchyprotocol hierarchy

IP/NW protocol

TP: TCP or UDP

applications : email, FTP, Telnet, WWW

network/internet

major Internet protocols major Internet protocols

“TCP/IP protocol suite” (1) IP internet protocol (2) UDP - user datagram protocol (3) TCP - transmission control protocol

-- 1 : network/internet layer -- 2,3 : transport layer

other major Internet protocolsother major Internet protocols

ARP, RARP, BOOTP - reconciling IP, LAN addresses

DNS - domain name system

SNMP - simple network mgt protocol

FTP - file transfer protocol

Telnet, Rlogin - remote terminal access

IP

TCP UDP

LAN/WAN

media

IGMPICMP

RARPARP

telnet, FTP, etc. TFTP, other apps.apps

UDP : user datagram protocol UDP : user datagram protocol

basic function of UDP --to provide a simple, fast, easy datagram service. (not connection-oriented, delivery not guaranteed)-interfaces between IP and the application

UDP : user datagram protocol UDP : user datagram protocol

-provides “bare bones” transport service-works as well as IP (best effort, no

guarantees)-adds source and destination port number

to packet and passes on to IP (multiplexing)

-does NOT provide sequencing

acknowledgmentsflow/congestion control

UDP packet formatUDP packet format

source port destination port

UDP length UDP checksum

DATA

0 15 31

protocol and port numbers protocol and port numbers

Q1: how does IP know who to hand a datagram off to (UDP, TCP, or other) ?

Q2: how does UDP know who to hand the data to?

0-1023 are “well-known port numbers”; others can be assigned on demand the term “port” was a poor choice of terms

reliable, stream transport : TCP reliable, stream transport : TCP

basic function of TCP --to provide reliable, connection-oriented data transfer service, between the local application (email, web, FTP, Telnet, etc) and the distant application.

internet

reliable, stream transport : TCP reliable, stream transport : TCP

5 features characterize TCP protocol service :

1. stream orientation

2. virtual circuit connection

3. buffered transfer

4. unstructured stream

5. full duplex connection

TCP connection : pair of socketsTCP connection : pair of sockets

TCP TCP

131.120.1.60 240.32.66.9internet

2075 21

(2075, 131.120.1.60) ---------------(21, 240.32.66.9)

TCP packet format TCP packet format source port destination port

sequence number (sending)

sequence number (acknowledgment)

TCP checksum

window size

urgent pointer

options (if any)

DATA

HLEN RES 6 flags

TCP fields, commentsTCP fields, comments

Header: 20 bytes minimum

data : 216 - 20(IP header) - 20(TCP header) = 65495 bytes maximum

port - TCP customer; i.e., FTP, email, etc.

TCP customer may do further multiplexing (why?)

socket : TCP endpoint; a pair (host, port) of integers

TCP connection : a pair (S1,S2) of sockets

TCP fields - flagsTCP fields - flags

URG - urgent pointer valid... if set, points to last byte of urgent data (implementations vary)

ACK - acknowledgment valid PSH - push; pass to app quickly as possible RST - reset the connection(close

connection immediately, error) SYN - synchronize sequence numbers to

initialize a connection FIN - finished sending data

more on TCPmore on TCP

opening connections - both sides must agree on parameters before data passed

connection establishment - 3 way handshake (SYN,SYN,ACK)

segments - one TCP packet

window size - variable, established when connection made

flow control

out of band data

TCP connection establishmentTCP connection establishment

3 way handshake (3 messages needed)1. “client” sends a connect request (SYN); this contains

(a) buffer space available (b) max incoming segment size(c) initial sequence number

2. “server” replies (SYN), same data.3. “client” acks the SYN, begins sending data

TCP connection establishmentTCP connection establishmentclient server

syn

syn

ack

TCP data transferTCP data transfer

each side sends data within parameter limits (window, sequencing, acks)

two main classes of data : bulk and interactive

connection may remain open for considerable time (hours)

when each side has no more data to send, connection is closed

TCP connection terminationTCP connection termination

normal case - initiated by either sideA : “finished, no more data to send” (FIN bit set)B : ackB : when done sending data, sets FIN bitA : acks

abnormal case - RST bit set, closes connection immediately

top related