TCP/IP Networking Fundamentals

Introduction to TCP/IP
networking
Mircho Mirchev
TCP/IP protocol family
IP : Internet Protocol
UDP : User Datagram Protocol
RTP, traceroute
TCP : Transmission Control Protocol
HTTP, FTP, ssh
others
IP proto numbers – 0-255
What is an internet?
A set of interconnected networks
The Internet is the most famous
example
Networks can be completely
different
Ethernet, ATM, modem, …
(TCP/)IP is what links them
What is an internet? (cont)
Routers (nodes) are devices on
multiple networks that pass traffic
between them
Individual networks pass traffic
from one router or endpoint to
another
TCP/IP hides the details as much as
possible
ISO/OSI Network Model
Seven network “layers”
Layer 1 : Physical – cables
Layer 2 : Data Link – ethernet
Layer 3 : Network – IP
Layer 4 : Transport – TCP/UDP
Layer 5 : Session
Layer 6 : Presentation
Layer 7 : Application
TCP/IP Network Model
Different view – 4 layers
Layer 1 : Link (we did not look at
details)
Layer 2 : Network
Layer 3 : Transport
Layer 4 : Application
OSI and Protocol Stack
 
OSI: Open Systems Interconnect
Link Layer           : includes device driver and network interface card
Network Layer     : handles the movement of packets, i.e. Routing
Transport Layer   : provides a reliable flow of data between two hosts
Application Layer : handles the details of the particular application
Packet Encapsulation
 
 The data is sent down the protocol stack
 Each layer adds to the data by prepending headers
22Bytes
20Bytes
20Bytes
4Bytes
64 to 1500 Bytes
Data flow and encapsulation
 
TCP/IP
A full suite of protocols spanning
layers 2 (Datalink) through 7
(Application)
Informally named for “Transmission
Control  Protocol” (Layer 4 -
Transport) and “Internet Protocol”
(Layer 3 - Network), it is comprised
of many protocols
MAJOR Layer Associations
Ethernet
PPP
MAC
DSL
ISDN
FDDI
D
a
t
a
l
i
n
k
L2TP (L2 Tunneling
protocol)
ARP (Address Resolution
Protocol)
NDP (Neighbor Discovery
Protocol)
RARP (Reverse ARP)
IARP (Inverse ARP)
MAJOR Layer Associations
IP (Internet Protocol)
IPv6 (IP Version 6)
ICMP/ICMPv6 (Internet Control
Message Protocol – e.g., “ping”)
RIPv6 (Routing Information Protocol)
OSPF (Open Shortest Path First)
Others…
N
e
t
w
o
r
k
MAJOR Layer Associations
TCP (Transmission Control Protocol) – Reliable,
in-sequence delivery of data, connection
oriented
UDP (User Datagram Protocol) – Connectionless,
delivery and sequence not guaranteed
RUDP (Reliable UDP)
BGP (Border Gateway Protocol)
SCTP (Stream Control Transmission Protocol)
Others…
T
r
a
n
s
p
o
r
t
MAJOR Layer Associations
DNS (Domain Name Service)
LDAP (Lightweight Directory Access
Protocol)
Others…
S
e
s
s
i
o
n
P
r
e
s
e
n
t
a
t
i
o
n
  LPP (Lightweight Presentation Protocol)
MAJOR Layer Associations
FTP (File Transfer Protocol)
SNMPvX (Simple Network Management Protocol,
versions 1-3)
POP3 (Post Office Protocol, version 3)
SMTP (Simple Mail Transfer Protocol)
Telnet
DHCP (Dynamic Host Configuration Protocol)
HTTP (HyperText Transfer Protocol)
Others…
(Only underlined protocols will be discussed further.)
A
p
p
l
i
c
a
t
i
o
n
Net+OS Provides…
TCP (thru Sockets)
UDP (thru
Sockets/Fast
Sockets & “Fast IP”)
DNS
T
r
a
n
s
p
o
r
t
S
e
s
s
i
o
n
A
p
p
l
i
c
a
t
i
o
n
 
 
 
 
D
H
C
P
 
 
 
 
S
N
M
P
 
A
g
e
n
t
 
 
 
 
F
T
P
 
C
l
i
e
n
t
 
&
 
S
e
r
v
e
r
 
 
 
T
e
l
n
e
t
 
C
l
i
e
n
t
 
 
 
 
H
T
T
P
/
A
d
v
a
n
c
e
d
 
W
e
b
 
S
e
r
v
e
r
s
 
 
 
 
E
m
a
i
l
 
(
P
O
P
3
/
S
M
T
P
)
 
C
l
i
e
n
t
s
IP
Responsible for end to end
transmission
Sends data in individual packets
Maximum size of packet is determined
by the networks
Fragmented if too large
Unreliable
Packets might be lost, corrupted,
duplicated, delivered out of order
IP packets
Source and destination addresses
Protocol number
1 = ICMP, 6 = TCP, 17 = UDP
Various options
e.g. to control fragmentation
Time to live (TTL)
Prevent routing loops
IPv4 in Practice
Header fields in Network Byte Order
Capable (when allowed) of
fragmentation and reassembly
Packet (datagram) format:
V
e
r
 
(
4
)
I
H
L
(
4
)
S
e
r
v
i
c
e
(
8
)
T
o
t
a
l
 
L
e
n
g
t
h
 
(
b
y
t
e
s
)
 
(
1
6
)
I
d
e
n
t
i
f
i
c
a
t
i
o
n
 
(
1
6
)
C
F
(
3
)
F
r
a
g
m
e
n
t
 
O
f
f
s
e
t
 
(
1
3
)
T
T
L
(
8
)
P
r
o
t
o
c
o
l
 
(
8
)
H
e
a
d
e
r
 
C
h
e
c
k
s
u
m
 
(
1
6
)
S
o
u
r
c
e
 
I
P
 
A
d
d
r
e
s
s
 
(
3
2
)
D
e
s
t
i
n
a
t
i
o
n
 
I
P
 
A
d
d
r
e
s
s
 
(
3
2
)
O
p
t
i
o
n
s
 
+
 
P
a
d
d
i
n
g
D
a
t
a
 
(
e
.
g
.
,
 
T
C
P
 
P
a
c
k
e
t
)
 
(
v
a
r
i
e
s
)
0                                                     16
32
IP Header Fields Explained
Ver – version of IP
IHL – Internet Header Length (32-bit words)
Service – Precedence/Delay/Throughput/Reliability
Identification – assistance in reassembling fragments
CF – control flags:
Reserved
1 to prevent fragmentation, else 0
1 if last fragment, else 0
Fragment Offset – of this fragment in total message,
bytes
TTL – Time to Live, upper limit of life enroute
Protocol – next higher protocol, e.g., TCP, UDP or ICMP
IP addresses
4 bytes
e.g. 163.1.125.98
Each device normally gets one (or more)
In theory there are about 4 billion
available
But…
Allocation of addresses
Controlled centrally by ICANN
Fairly strict rules on further delegation
to avoid wastage
Have to demonstrate actual need for them
Organizations that got in early have
bigger allocations than they really
need
Routing
How does a device know where to
send a packet?
All devices need to know what IP
addresses are on directly attached
networks
If the destination is on a local network,
send it directly there
Routing (cont)
If the destination address isn’t local
Most non-router devices just send
everything to a single local router
Routers need to know which network
corresponds to each possible IP address
UDP
Thin layer on top of IP
Adds packet length + checksum
Guard against corrupted packets
Also source and destination ports
Ports are used to associate a packet with a
specific application at each end
Still unreliable:
Duplication, loss, out-of-orderness possible
UDP in Practice
Connectionless protocol
Delivery and sequence not guaranteed
“Rides on” IP
Header fields in Network Byte Order
Packet (datagram) format:
S
o
u
r
c
e
 
P
o
r
t
 
(
1
6
 
b
i
t
s
)
D
e
s
t
i
n
a
t
i
o
n
 
P
o
r
t
 
(
1
6
 
b
i
t
s
)
L
e
n
g
t
h
 
(
1
6
 
b
i
t
s
)
C
h
e
c
k
s
u
m
 
(
1
6
 
b
i
t
s
)
P
a
y
l
o
a
d
 
(
v
a
r
i
e
s
)
0                                                 16                                              32
 
 
UDP datagram
Destination Port
Source Port
Application  data
0
16
31
Checksum
Length
F
i
e
l
d
P
u
r
p
o
s
e
Source Port
 
16-bit port number identifying originating application
Destination Port
 
16-bit port number identifying destination application
Length
  
Length of UDP datagram (UDP header + data)
Checksum
  
Checksum of IP pseudo header, UDP header, and data
Typical applications of UDP
Where packet loss etc is better handled by
the application than the network stack
Where the overhead of setting up a
connection isn’t wanted
VOIP
NFS – Network File System
Most games
TCP
Reliable, full-duplex, connection-
oriented, stream delivery
Interface presented to the application
doesn’t require data in individual
packets
Data is guaranteed to arrive, and in the
correct order without duplications
Or the connection will be dropped
Imposes significant overheads
TCP in Practice
Connection-oriented
In-sequence delivery guaranteed
“Rides” on IP
Header Fields in Network Byte Order
Packet format:
S
o
u
r
c
e
 
P
o
r
t
 
(
1
6
)
D
e
s
t
i
n
a
t
i
o
n
 
P
o
r
t
 
(
1
6
)
0                                                 16                                              32
S
e
q
u
e
n
c
e
 
N
u
m
b
e
r
 
o
f
 
F
i
r
s
t
 
D
a
t
a
 
O
c
t
e
t
 
(
3
2
)
N
e
x
t
 
E
x
p
e
c
t
e
d
 
A
c
k
 
N
u
m
b
e
r
 
(
3
2
)
W
i
n
d
o
w
 
(
1
6
)
C
h
e
c
k
s
u
m
 
(
1
6
)
O
f
s
t
(
4
)
R
s
v
d
(
6
)
F
l
a
g
s
(
6
)
O
p
t
i
o
n
s
 
+
 
P
a
d
 
(
v
a
r
i
e
s
)
P
a
y
l
o
a
d
 
(
v
a
r
i
e
s
)
U
r
g
e
n
t
 
D
a
t
a
 
P
o
i
n
t
e
r
 
(
1
6
)
 
 
TCP Segment
Destination Port
Acknowledgment Number
Options...
Padding
Data...
0
4
10
16
19
24
31
Source Port
Window
Len
Sequence Number
Reserved
Flags
Urgent Pointer
Checksum
F
i
e
l
d
P
u
r
p
o
s
e
Source Port
  
Identifies originating application
Destination Port
 
Identifies destination application
Sequence Number
 
Sequence number of first octet in the segment
Acknowledgment #
 
Sequence number of the next expected octet (if ACK flag set)
Len
  
Length of TCP header in 4 octet units
Flags
  
TCP flags: SYN, FIN, RST, PSH, ACK, URG
Window
  
Number of octets from ACK that sender will accept
Checksum
  
Checksum of IP pseudo-header + TCP header + data
Urgent Pointer
 
Pointer to end of “urgent data”
Options
  
Special TCP options such as MSS and Window Scale
You just need to know port numbers, seq and ack are added
TCP Header Fields Explained
Ofst - Data offset/length of header in 32-bit words
Rsvd - Reserved
Flags
Urgent Data Pointer Significant (URG)
Ack Field Significant (ACK)
Reset Connection (RST)
Push Function (PSH) – prompt forwarding
Synchronize Sequence Numbers (SYN) – seq # is initial
No More Data (FIN)
Window - number of octets sender will accept
Option - one octet OR one octet type + one octet length
+ n octets option information
Applications of TCP
Most things!
HTTP, FTP, …
Saves the application a lot of work,
so used unless there’s a good reason
not to
TCP implementation
Connections are established using a
three-way handshake
Data is divided up into packets by
the operating system
Packets are numbered, and received
packets are acknowledged
Connections are explicitly closed
(or may abnormally terminate)
TCP Packets
Source + destination ports
Sequence number (used to order
packets)
Acknowledgement number (used to
verify packets are received)
TCP : Data transfer
Host
Client
Send Packet 1
Start Timer
Retransmit Packet1
Start Timer
Packet should arrive 
ACK should be sent
ACK would normally
Arrive at this time
Receive Packet 1
Send AXK 1
Time Expires
Receive ACK 1
Cancel Timer
Packet Lost
Timer
Timer
Slide Note
Embed
Share

Explore the basics of TCP/IP networking, including protocols like IP, UDP, RTP, and more. Learn about the structure of the Internet, the role of routers, OSI network model, TCP/IP network model, and packet encapsulation in data transmission. Gain insights into the layers of the OSI model and the TCP/IP hierarchy.

  • TCP/IP Networking
  • OSI Model
  • Internet Protocols
  • Data Transmission
  • Network Layers

Uploaded on Jul 18, 2024 | 2 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Introduction to TCP/IP networking Mircho Mirchev

  2. TCP/IP protocol family IP : Internet Protocol UDP : User Datagram Protocol RTP, traceroute TCP : Transmission Control Protocol HTTP, FTP, ssh others IP proto numbers 0-255

  3. What is an internet? A set of interconnected networks The Internet is the most famous example Networks can be completely different Ethernet, ATM, modem, (TCP/)IP is what links them

  4. What is an internet? (cont) Routers (nodes) are devices on multiple networks that pass traffic between them Individual networks pass traffic from one router or endpoint to another TCP/IP hides the details as much as possible

  5. ISO/OSI Network Model Seven network layers Layer 1 : Physical cables Layer 2 : Data Link ethernet Layer 3 : Network IP Layer 4 : Transport TCP/UDP Layer 5 : Session Layer 6 : Presentation Layer 7 : Application

  6. TCP/IP Network Model Different view 4 layers Layer 1 : Link (we did not look at details) Layer 2 : Network Layer 3 : Transport Layer 4 : Application

  7. OSI: Open Systems Interconnect OSI and Protocol Stack OSI Model TCP/IP Hierarchy Protocols 7th Application Layer 6th Application Layer Presentation Layer 5th Session Layer 4th Transport Layer Transport Layer 3rd Network Layer Network Layer 2nd Link Layer Link Layer 1st Physical Layer Link Layer : includes device driver and network interface card Network Layer : handles the movement of packets, i.e. Routing Transport Layer : provides a reliable flow of data between two hosts Application Layer : handles the details of the particular application

  8. Packet Encapsulation The data is sent down the protocol stack Each layer adds to the data by prepending headers 22Bytes 20Bytes 20Bytes 4Bytes 64 to 1500 Bytes

  9. Data flow and encapsulation

  10. TCP/IP A full suite of protocols spanning layers 2 (Datalink) through 7 (Application) Informally named for Transmission Control Protocol (Layer 4 - Transport) and Internet Protocol (Layer 3 - Network), it is comprised of many protocols

  11. MAJOR Layer Associations Datalink Ethernet L2TP (L2 Tunneling protocol) PPP ARP (Address Resolution Protocol) MAC DSL NDP (Neighbor Discovery Protocol) ISDN RARP (Reverse ARP) FDDI IARP (Inverse ARP)

  12. MAJOR Layer Associations Network IP (Internet Protocol) IPv6 (IP Version 6) ICMP/ICMPv6 (Internet Control Message Protocol e.g., ping ) RIPv6 (Routing Information Protocol) OSPF (Open Shortest Path First) Others

  13. MAJOR Layer Associations Transport TCP (Transmission Control Protocol) Reliable, in-sequence delivery of data, connection oriented UDP (User Datagram Protocol) Connectionless, delivery and sequence not guaranteed RUDP (Reliable UDP) BGP (Border Gateway Protocol) SCTP (Stream Control Transmission Protocol) Others

  14. MAJOR Layer Associations Session DNS (Domain Name Service) LDAP (Lightweight Directory Access Protocol) Others Presentation LPP (Lightweight Presentation Protocol)

  15. MAJOR Layer Associations Application FTP (File Transfer Protocol) SNMPvX (Simple Network Management Protocol, versions 1-3) POP3 (Post Office Protocol, version 3) SMTP (Simple Mail Transfer Protocol) Telnet DHCP (Dynamic Host Configuration Protocol) HTTP (HyperText Transfer Protocol) Others (Only underlined protocols will be discussed further.)

  16. Net+OS Provides Transport Session TCP (thru Sockets) UDP (thru Sockets/Fast Sockets & Fast IP ) Application DNS DHCP Telnet Client SNMP Agent HTTP/Advanced Web Servers Email (POP3/SMTP) Clients FTP Client & Server

  17. IP Responsible for end to end transmission Sends data in individual packets Maximum size of packet is determined by the networks Fragmented if too large Unreliable Packets might be lost, corrupted, duplicated, delivered out of order

  18. IP packets Source and destination addresses Protocol number 1 = ICMP, 6 = TCP, 17 = UDP Various options e.g. to control fragmentation Time to live (TTL) Prevent routing loops

  19. IPv4 in Practice Header fields in Network Byte Order Capable (when allowed) of fragmentation and reassembly Packet (datagram) format: 0 16 32 Ver (4) IHL(4) Identification (16) TTL(8) Total Length (bytes) (16) CF(3) Fragment Offset (13) Header Checksum (16) Source IP Address (32) Destination IP Address (32) Options + Padding Data (e.g., TCP Packet) (varies) Service(8) Protocol (8)

  20. IP Header Fields Explained Ver version of IP IHL Internet Header Length (32-bit words) Service Precedence/Delay/Throughput/Reliability Identification assistance in reassembling fragments CF control flags: Reserved 1 to prevent fragmentation, else 0 1 if last fragment, else 0 Fragment Offset of this fragment in total message, bytes TTL Time to Live, upper limit of life enroute Protocol next higher protocol, e.g., TCP, UDP or ICMP

  21. IP addresses 4 bytes e.g. 163.1.125.98 Each device normally gets one (or more) In theory there are about 4 billion available But

  22. Allocation of addresses Controlled centrally by ICANN Fairly strict rules on further delegation to avoid wastage Have to demonstrate actual need for them Organizations that got in early have bigger allocations than they really need

  23. Routing How does a device know where to send a packet? All devices need to know what IP addresses are on directly attached networks If the destination is on a local network, send it directly there

  24. Routing (cont) If the destination address isn t local Most non-router devices just send everything to a single local router Routers need to know which network corresponds to each possible IP address

  25. UDP Thin layer on top of IP Adds packet length + checksum Guard against corrupted packets Also source and destination ports Ports are used to associate a packet with a specific application at each end Still unreliable: Duplication, loss, out-of-orderness possible

  26. UDP in Practice Connectionless protocol Delivery and sequence not guaranteed Rides on IP Header fields in Network Byte Order Packet (datagram) format: 0 16 32 Source Port (16 bits) Length (16 bits) Payload (varies) Destination Port (16 bits) Checksum (16 bits)

  27. UDP datagram 0 16 31 Source Port Destination Port Length Checksum Application data Field Source Port Destination Port Length Checksum Purpose 16-bit port number identifying originating application 16-bit port number identifying destination application Length of UDP datagram (UDP header + data) Checksum of IP pseudo header, UDP header, and data

  28. Typical applications of UDP Where packet loss etc is better handled by the application than the network stack Where the overhead of setting up a connection isn t wanted VOIP NFS Network File System Most games

  29. TCP Reliable, full-duplex, connection- oriented, stream delivery Interface presented to the application doesn t require data in individual packets Data is guaranteed to arrive, and in the correct order without duplications Or the connection will be dropped Imposes significant overheads

  30. TCP in Practice Connection-oriented In-sequence delivery guaranteed Rides on IP Header Fields in Network Byte Order Packet format: 0 16 32 Source Port (16) Sequence Number of First Data Octet (32) Next Expected Ack Number (32) Ofst(4) Rsvd(6) Flags(6) Destination Port (16) Window (16) Urgent Data Pointer (16) Checksum (16) Options + Pad (varies) Payload (varies)

  31. TCP Segment 0 4 10 16 19 24 31 Source Port Destination Port Sequence Number Acknowledgment Number Len Reserved Flags Window Checksum Urgent Pointer Options... Padding Data... Field Source Port Destination Port Sequence Number Acknowledgment # Len Flags Window Checksum Urgent Pointer Options Purpose Identifies originating application Identifies destination application Sequence number of first octet in the segment Sequence number of the next expected octet (if ACK flag set) Length of TCP header in 4 octet units TCP flags: SYN, FIN, RST, PSH, ACK, URG Number of octets from ACK that sender will accept Checksum of IP pseudo-header + TCP header + data Pointer to end of urgent data Special TCP options such as MSS and Window Scale You just need to know port numbers, seq and ack are added

  32. TCP Header Fields Explained Ofst - Data offset/length of header in 32-bit words Rsvd - Reserved Flags Urgent Data Pointer Significant (URG) Ack Field Significant (ACK) Reset Connection (RST) Push Function (PSH) prompt forwarding Synchronize Sequence Numbers (SYN) seq # is initial No More Data (FIN) Window - number of octets sender will accept Option - one octet OR one octet type + one octet length + n octets option information

  33. Applications of TCP Most things! HTTP, FTP, Saves the application a lot of work, so used unless there s a good reason not to

  34. TCP implementation Connections are established using a three-way handshake Data is divided up into packets by the operating system Packets are numbered, and received packets are acknowledged Connections are explicitly closed (or may abnormally terminate)

  35. TCP Packets Source + destination ports Sequence number (used to order packets) Acknowledgement number (used to verify packets are received)

  36. TCP : Data transfer Client Host Send Packet 1 Start Timer Packet Lost Packet should arrive ACK should be sent Timer ACK would normally Arrive at this time Time Expires Retransmit Packet1 Start Timer Receive Packet 1 Send AXK 1 Timer Receive ACK 1 Cancel Timer

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#