filmov
tv
What is the Transport Layer and TCP? - Part 1

Показать описание
A mini lecture, examining the role of the Transport Layer in the Internet Protocol Suite, including TCP, UDP, and source and destination port numbers. I also cover the characteristics of the TCP protocol including reliability, flow control, window size, and the three-way handshake. Subscribe to danscourses!
TCP/IP Model
------------
Application Layer
Transport Layer
Internet Layer
Link Layer Layer
=====================
Transport Layer
=====================
Transport Layer offers:
- support for end-to-end services (gives end-to-end support to application layer services)
- support for multiplexing (multiple conversations happening at the same time over the wire)
- services to port numbers mapping (port 80=http, port 21=ftp, port 53=dns, port 25=smtp, port 22=ssh)
- services that need reliabiity use TCP (http, smtp, ftp, ssh)
- services that don't need reliability or need speed use UDP (dns, dhcp, VoIP)
When we send data over the network, the Transport Layer breaks the data into pieces:
- the pieces that data is broken into are called "segments" for TCP, and "datagrams" for UDP,
- each piece is given dst and src addressing at layers 2 and 3 so the pieces can reach their dest and then return
- each piece is given dst and src port numbers at layer 4 (Transport) so each conversation/service can be identified
Servers "listen" and "reply" using port numbers, examples:
- a web server is listening on port 80,
- a DNS server is listening on port 53,
- a telnet server is listening on port 23
Clients "connect" and "receive" using port numbers
Packet
(Client web browser connects using http GET) from -------[\/]--------to (server listens on port 80)
src port=50132
dst port=80
(Client web browser receives http REPLY) to----------[\/]-----------from (server replies with http REPLY)
src port=80
dst port=50132
TCP (transport control protocol)
===========================
- reliable (sequence numbers, acknowlegements ACKs, selective acknowledgements SACKs,
flow control, window size, retransmit lost packets),
- connection oriented (uses a 3-way handshake to start the session),
- slow and reliable,
- as such, the TCP protocol has many settings (header fields, flags)
- uses source and destination port numbers to identify service and host
TCP 3-way handshake
=================================
Client Server
-------------------------------------------------------------------
1 Syn(seq=0) -----)
2 (----- Ack(ack=1),Syn(seq=0)
3 Ack(ack=1) -----)
Two 2-way handshake (end transmission)
----------------------------------------------
1 Fin, Ack -----)
2 (----- Ack
3 (----- Fin
4 Ack ------)
UDP (user datagram protocol)
=============================
- unreliable - no seq numbers, no acknowledgement, no retransmission
- connectionless - no 3-way handshake
- faster than tcp but not reliable
- header is smaller with fewer fields
- uses source and destination port numbers to identify service and host
Ports
================================================
Well Known 1--1023 (whois, icmp, http, ssh, telnet, rip, dhcp)
Ephemeral
- Registered 1024--49151 (can be registered yearly from icann, for consumer services/servers)
- Dynamic 49152--65536 (dynamically assigned ephemeral)
TCP/IP Model
------------
Application Layer
Transport Layer
Internet Layer
Link Layer Layer
=====================
Transport Layer
=====================
Transport Layer offers:
- support for end-to-end services (gives end-to-end support to application layer services)
- support for multiplexing (multiple conversations happening at the same time over the wire)
- services to port numbers mapping (port 80=http, port 21=ftp, port 53=dns, port 25=smtp, port 22=ssh)
- services that need reliabiity use TCP (http, smtp, ftp, ssh)
- services that don't need reliability or need speed use UDP (dns, dhcp, VoIP)
When we send data over the network, the Transport Layer breaks the data into pieces:
- the pieces that data is broken into are called "segments" for TCP, and "datagrams" for UDP,
- each piece is given dst and src addressing at layers 2 and 3 so the pieces can reach their dest and then return
- each piece is given dst and src port numbers at layer 4 (Transport) so each conversation/service can be identified
Servers "listen" and "reply" using port numbers, examples:
- a web server is listening on port 80,
- a DNS server is listening on port 53,
- a telnet server is listening on port 23
Clients "connect" and "receive" using port numbers
Packet
(Client web browser connects using http GET) from -------[\/]--------to (server listens on port 80)
src port=50132
dst port=80
(Client web browser receives http REPLY) to----------[\/]-----------from (server replies with http REPLY)
src port=80
dst port=50132
TCP (transport control protocol)
===========================
- reliable (sequence numbers, acknowlegements ACKs, selective acknowledgements SACKs,
flow control, window size, retransmit lost packets),
- connection oriented (uses a 3-way handshake to start the session),
- slow and reliable,
- as such, the TCP protocol has many settings (header fields, flags)
- uses source and destination port numbers to identify service and host
TCP 3-way handshake
=================================
Client Server
-------------------------------------------------------------------
1 Syn(seq=0) -----)
2 (----- Ack(ack=1),Syn(seq=0)
3 Ack(ack=1) -----)
Two 2-way handshake (end transmission)
----------------------------------------------
1 Fin, Ack -----)
2 (----- Ack
3 (----- Fin
4 Ack ------)
UDP (user datagram protocol)
=============================
- unreliable - no seq numbers, no acknowledgement, no retransmission
- connectionless - no 3-way handshake
- faster than tcp but not reliable
- header is smaller with fewer fields
- uses source and destination port numbers to identify service and host
Ports
================================================
Well Known 1--1023 (whois, icmp, http, ssh, telnet, rip, dhcp)
Ephemeral
- Registered 1024--49151 (can be registered yearly from icann, for consumer services/servers)
- Dynamic 49152--65536 (dynamically assigned ephemeral)
Комментарии