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

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

Embed Size (px)

Citation preview

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

CS3505 CS3505 The Internet and Info The Internet and Info

HiwayHiwaytransport layer protocols : transport layer protocols :

TCP/UDPTCP/UDP

Page 2: CS3505 The Internet and Info Hiway transport layer protocols : TCP/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

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

TCP/IP internet TCP/IP internet

WAN

IP

WAN

IP

IP

IP ...TCP/IP

TCP/IP

TCP/IP

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

protocol hierarchyprotocol hierarchy

IP/NW protocol

TP: TCP or UDP

applications : email, FTP, Telnet, WWW

network/internet

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

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

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

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

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

IP

TCP UDP

LAN/WAN

media

IGMPICMP

RARPARP

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

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

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

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

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

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

UDP packet formatUDP packet format

source port destination port

UDP length UDP checksum

DATA

0 15 31

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

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

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

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

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

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

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

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)

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

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

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

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

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

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

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

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

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

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

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

TCP connection establishmentTCP connection establishmentclient server

syn

syn

ack

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

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

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

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