essentials of the internet protocol and tcp/ip architecture
TRANSCRIPT
2008/2009
Essentials of the Internet Protocoland TCP/IP Architecture
Prepared by:Ignac Lovrek, Maja Matijašević, Gordan Gledec, Gordan Ježić, Josip Gracin, Domagoj Mikac, Ognjen Dobrijević, Vedran Podobnik
University of ZagrebFaculty of Electrical Engineering and ComputingDepartment of Telecommunications
2008/2009
Introduction
History and size of the InternetInternet hierarchyStandards organizationsRequest for Comments series
Size of the Internet
University of Zagreb, FER SIF 2744, 2008/2009 3 of 48
Internet hierarchy
LANcorporate network
SIF 2744, 2008/2009University of Zagreb, FER 4 of 48
Tier 1
Home userphone, ISDN,xDSL, cable
ISP
ISP
IXP
ISP ISPISP
IXP
POP POP
ISPISP
POP
POPPOP
IXPPOP
ISP
direct peeringISP Legend:
ISP - Internet Service ProviderIXP - Internet Exchange PointPOP - Internet Point of Presence
Tier 2
Tier 3
Internet standards organizations
Internet ArchitectureBoard IAB
Internet EngineeringTask Force IETF
Internet EngineeringSteering Group IESG
Internet ResearchTask Force IRTF
Internet ResearchSteering Group IRSG
RFC Editor
Internet Corporation for AssignedNames and Numbers ICANN(Internet Assigned Numbers
Authority IANA is now under ICANN)
World Wide WebConsortium W3C
InternationalTelecommunication
Union ITU
Internet SocietyISOC
3rd GenerationPartnership Project
3GPPIP address space allocation- 5 Regional Internet Registries (RIRs); RIPE NCC for EuropeProtocol identifier assignmentDomain name system management
EuropeanTelecommunications
Standards Institute ETSI
standardizationThe amount of standardization within the Internet is the minimum necessary for
effective interworking.
administration collaboration
University of Zagreb, FER SIF 2744, 2008/2009 5 of 48
Requests for Comment (RFC) series
♦ RFC documents are a series of memoranda encompassing new research, innovations, and methodologies applicable to Internet technologies
♦ RFC Editor (team) edits and publishes RFCs onlineRFC Index http://www.rfc-editor.org/rfc-index.html
RFC Editor issues each RFC document with a unique serial numberonce published, RFCs never change – errata are published separatelyRFC subseries
Internet Standard (STD), For Your Information (FYI), Best Current Practice (BCP)
also important: RFC status – may be “standards track” (proposed standard, draft standard, Internet standard), or other (informational, experimental, BCP, or historic)
♦ the IETF adopts some of the proposals published in RFCs as Internet standards - not all RFCs are/become Internet standards; only ~70 STDs out of 5300+ (as of Nov. 2008) RFCs
University of Zagreb, FER SIF 2744, 2008/2009 6 of 48
2008/2009
Structure of the Internet
Logical and physical viewAutonomous System
Logical vs. physical view
Legend: SN – subnet
University of Zagreb, FER SIF 2744, 2008/2009 8 of 48
logical view -one global network
physical view -network of networks
Internet
Autonomous system
♦ Autonomous system (AS)collection of IP networks and routers under the control of one entity (or sometimes more) that presents a common routing policy to the Internet
♦ a unique AS number (ASN) is assigned by IANAfor example, AS2108 CARNET-AS Croatian Academic and Research Network
routing view -collection of ASs
Legend: SN - subnetAS – autonomous system
University of Zagreb, FER SIF 2744, 2008/2009 9 of 48
2008/2009
Protocol stack and the role of TCP/IP
Reference networking modelComparison of OSI and Internet TCP/IP modelTCP/IP functionality
Reference Networking Model
♦ provides an abstract view of network architecture
♦ concept of layeringeach layer implements a set of well-defined functionalitieseach layer provides the foundation and the services required by the layer aboveeach layer-n entity interacts directly only with the layer immediately beneath it, and provides facilities for use by the layer above it
♦ protocol suite = collection of protocols organized into layersprotocol is a “language” that enables an entity in one host to interact with a cooresponding entity (peer) at the same layer in a remote hoststandardized interfaces
University of Zagreb, FER SIF 2744, 2008/2009 11 of 48
Comparison between OSI and TCP/IP architecture
Open Systems Interconnection
Link layer
Network layer
Transport layer
Application layer
TCP/IP (Internet)
Data Link layer
Physical layer
Application layer
Presentation layer
Network layer
Transport layer
Session layer
Application layer
Network layer
Transport layer
Presentation layer
Session layer
Link layer
Network layer
Transport layer
Application layer
Physical layer
Data Link layer
(Physical layer)
University of Zagreb, FER SIF 2744, 2008/2009 12 of 48
TCP/IP protocol stack
Link layer
Network layer
Transport layer
Application layer
IP routing(RIP, OSPF, BGP)
control (ICMP, IGMP) AR
P
RARP
TCP UDPFT
PTe
lnet
DNS
SMTP
HTTP
TFTP
SNMP
RTP
IP - Internet ProtocolICMP - Internet Control Message ProtocolARP - Address Resolution ProtocolRARP - Reverse Address Resolution ProtocolTCP - Transmission Control ProtocolUDP - User Datagram ProtocolFTP - File Transfer Protocol
SMTP - Simple Mail Transfer ProtocolHTTP - HyperText Transfer ProtocolDNS - Domain Name SystemTFTP - Trivial File Transfer ProtocolSNMP - Simple Network Management ProtocolRTP - Real-time Transport Protocol
Ethernet/IEEE802.x, PPP, ATM, ...
WWW
University of Zagreb, FER SIF 2744, 2008/2009 13 of 48
How TCP/IP works – encapsulation example
data
dataHTTP
dataHTTP
TCP
dataHTTPTCPIP
F
dataHTTP dataTCP
TCPIP
TCPIPF
data
data20 byte 20 byte
46-1500 byte 4 byte14 byte
Transport layer
Network layer
Link layer
Application layer(web appl.)
dataHTTPTCPIP
(Ethernet/IEEE802.3)
University of Zagreb, FER SIF 2744, 2008/2009 14 of 48
2008/2009
Network Layer functionality
Internet Protocol – IPv4Control ProtocolsRouting Protocols
Network layer functionality
♦ connectionless transfer of datagrams → unreliable service♦ each datagram is being independently routed based on IP destination address♦ “best effort” service
Example:♦ node A sends to B: ♦ datagrams may traverse different paths and arrive in a different order, e.g. :
1 2 3
1 23
22
123
12
32
2
2 2
3
3 3
3
3
33
1
1 1
11
A B
3
2
1
University of Zagreb, FER SIF 2744, 2008/2009 16 of 48
2008/2009
Internet Protocol v4
IP featuresDatagram formatFragmentation and reassemblyIP addressing and naming
Internet Protocol
♦ IP, version 4♦ connectionless unreliable transfer of datagrams♦ specified in RFC 791, STD-5♦ defines the Internet addressing scheme
unique address spaceeach host has one unique IP addresses per interfacea host may also use other special addresses (e.g. localhost, multicast, broadcast ,…)if source and destination are located in different networks, IP datagrams are routed through one or more IP routers
♦ defines how to handle fragmentationa datagram must fit in the frame of specific lower layer protocoldatagram bigger than the frame must be fragmentedreceiving side reassembles the fragments
University of Zagreb, FER SIF 2744, 2008/2009 18 of 48
IP datagram format
header,20 octets
max. 60 octets
dataTCPIPF
version Type of Service Total LengthHdr. LenIdentification Fragment Offset
Protocol Header ChecksumTime to LiveSource IP address
Destination IP addressOptions Padding
Higher layer data
Flags
32 bits
University of Zagreb, FER SIF 2744, 2008/2009 19 of 48
IP datagram size - fragmentation and reassembly
♦ datagram must be small enough to fit into the frame of the lower layer protocol
MTU - Maximum Transmission Unitmedia dependentfor example, Ethernet/IEEE 802.3: 1500 bytes
♦ otherwise, the datagram must be split or fragmented into several datagrams
♦ fragments are sent independently and reassembled into the original message at the destination
MTU=1500 MTU=576
fragmentation reassembly
MTU=1500source destination
University of Zagreb, FER SIF 2744, 2008/2009 20 of 48
2008/2009
IP addressing and naming
IP address structureTypes of IP addressesDomain Name SystemAddress Resolution Protocol Internet Control Message Protocol
IP addressing
♦ IP address provides unique identification of the network interfacea device can have more than one interfacedifferent from the physical (MAC) addresses
♦ IP address is required to ensure that the IP datagram is delivered to the correct recipient
♦ Address representation32 bit binary number
hard to read and remember
10100001 00110101 00010011 11001001
161 53 19 201. . .Dotted-decimal notation
easier to rememberSymbolic address or name (hosts.txt)
University of Zagreb, FER SIF 2744, 2008/2009 22 of 48
IP address structure
♦ IP address has two parts:Network Identifier (Net ID)
a certain number of bits (starting from the left-most bit), used to identify the network where the network interface is locatednetwork prefix
Host Identifier (Host ID)the remainder of the bits used to identify the network interface in the network specified with Net ID
♦ type of IP addressunicast, broadcast, multicast
10100001 00110101 00010011 11001001
161 53 19 201. . .
Net ID Host ID
University of Zagreb, FER SIF 2744, 2008/2009 23 of 48
Classes of IP adresses
Class A: 0.0.0.0 - 127.255.255.2550 Net ID Host IDClass B: 128.0.0.0 - 191.255.255.2551 0 Net ID Host IDClass C: 192.0.0.0 - 223.255.255.2551 1 0 Net ID Host IDClass D: 224.0.0.0 - 239.255.255.2551 1 1 0 multicastClass E: 240.0.0.0 - 247.255.255.2551 1 1 1 0 reserved
Number of possible networks
Number of hosts per network
Class A 27-2 = 126 224-2 = 16,277,214
Class B 214 = 16,384 216-2 = 65,534
Class C 221 = 2,097,152 28-2 = 254
University of Zagreb, FER SIF 2744, 2008/2009 24 of 48
Classless addressing scheme
♦ prefix-based representation of IP address♦ partitioning between the NetID and HostID can occur at any
bit boundary in the address♦ length of Net ID is specified with the network prefix following the IP
address
11000011.00011000.00000000.00000000
195.24.0.0/13
network prefix
♦ introduced for the purposes of Classless Inter-Domain Routing (CIDR)network part (NetID) of the IP address is not determined by address classeliminates the significance of address classes for route aggregation(that’s why CIDR is termed classless)
University of Zagreb, FER SIF 2744, 2008/2009 25 of 48
Types of IP addresses
Public address space♦ for use in public Internet♦ IP address must be globally unique
♦ two devices connected to the public Internet cannot have the same IP address
♦ routing must be possible ♦ IANA, ICANN, RIPE...
Private address space♦ for use in private internets♦ organization manages the entire private address space♦ IP addresses within the private network must be unique♦ blocks of IP address space for private internets specified
by IANA: 10/8, 172.16/12, 192.168/16
IP Network Address Translator (NAT)
Reserved address space♦ “this” network 0.0.0.0/8♦ loopback 127.0.0.0/8♦ multicast 224.0.0.0/4♦ broadcast - Host ID all 1s ♦ blocks reserved by IANA, some
subject to allocation, some not
IPv4 Address Space(RFC 3330)
University of Zagreb, FER SIF 2744, 2008/2009 26 of 48
The role of NAT – example
B: 161.53.19.201
NAT
private Internet(address space 10/8)
A: 10.0.0.1
NAT binding:10.0.0.1 ↔ 139.130.1.1
source: 10.0.0.1destination: 161.53.19.201 source: 139.130.1.1
destination: 161.53.19.201
source: 161.53.19.201destination: 139.130.1.1
source: 161.53.19.201destination: 10.0.0.1
public Internet
datagram A->B
datagram B->A
X: 139.130.1.1(public IP address space )
University of Zagreb, FER SIF 2744, 2008/2009 27 of 48
Obtaining an IP address
♦ static address assignmentIP address is manually configured for a network device (i.e. IP phone)acceptable for small networks, complicated for large networksusually applied for network servers, routers and other devices that never change their IP addresses
♦ dynamic address assignmentIP address and other network settings received from a serversimplifies address assignment in large networks (e.g. corporation, ISP)DHCP – Dynamic Host Configuration Protocol (RFC 2131)
successor to BOOTP – Bootstrap ProtocolDHCP server leases an IP address from a previously configured address range to a device for a specific time (allows serial reassignment of IP address)DHCP server provides entire TCP/IP configuration (IP address, subnet mask, default gateway)
University of Zagreb, FER SIF 2744, 2008/2009 28 of 48
Domain Name System (DNS)
♦ numerical IP adresses are hard to remember – a name may be assigned for easier reference
♦ Domain Name System“(...) the idea of a hierarchical name space, with the hierarchy roughly corresponding to organizational structure, and names using ‘.’ as the character to mark the boundary between hierarchy levels.” (RFC 1034)a “directory service” for the Internetdomain – a group of computers most commonly associated by the organization they belong to
top level domain (generic, country)subdomains, for example: .hr, fer.hr, tel.fer.hr
Fully Qualified Domain Name uniquely identifies the host on the Internetfor example, www.tel.fer.hr
maintained as the hierarchical database distributed on the Internetroot DNS server on the top of the hierarchyother DNS servers have authority over their zones/domains
University of Zagreb, FER SIF 2744, 2008/2009 29 of 48
DNS Example
SIF 2744, 2008/2009University of Zagreb, FER 30 of 48
applicationresolver
local DNS server
root DNS128.9.0.107
DNS for .hr161.53.3.7
DNS for .fer.hr161.53.72.21
DNS for tel.fer.hr161.53.19.203
query for www.tel.fer.hr
www.tel.fer.hr?
DNS for .hr
www.tel.fer.hr?
www.tel.fer.hr?
www.tel.fer.hr?
DNS for fer.hr
DNS for tel.fer.hr
161.53.19.221
www.
tel.fe
r.hr?
161.53.19.221
2.
3.
4.
5.
6.1.
hr at fi
fer foi
tel zesoi zpm
.
www oluja
2008/2009
Routing protocols
Classless Interdomain RoutingRouting Information ProtocolOpen Shortest Path FirstBorder Gateway Protocol
IP Routing
♦ Internet is a packet-switching network♦ Classless Inter-Domain Routing – CIDR (RFC 4632)
destination IP address is matched based on NetIDpackets (IP datagrams) are routed independently of each other
♦ no end-to-end connectionhop-by-hop routing
♦ each router contains a routing table which contains its information on the topology of the network
used for matching a destination address to the outgoing network interface entries (i.e. rows) in routing table contain:
destination addressIP address of the next-hop router on the way to the destination
default route – special entry in routing tablematches all destinations – 0.0.0.0/0considered when no other more specific routes are foundused, for example, in leaf networks
University of Zagreb, FER SIF 2744, 2008/2009 32 of 48
Routing Example (1)
`
`
`
175.204.18
196.84.4
175.204.18.2
175.204.18.1
196.84.7.1
196.84.7.3
196.84.4.12
196.84.4.1
196.84.7
Network dest. Network mask Gateway Interface
196.84.4.0 255.255.255.0 196.84.4.12 196.84.4.12
default/0.0.0.0 0.0.0.0 196.84.4.1 196.84.4.12
Network dest. Network mask Gateway Interface
196.84.7.0 255.255.255.0 196.84.7.3 196.84.7.3
196.84.4.0 255.255.255.0 196.84.4.1 196.84.4.1
default/0.0.0.0 0.0.0.0 196.84.7.1 196.84.7.3
Network dest. Network mask Gateway Interface
196.84.7.0 255.255.255.0 196.84.7.1 196.84.7.1
196.84.4.0 255.255.255.0 196.84.7.3 196.84.7.1
175.204.18.0 255.255.255.0 175.204.18.2 175.204.18.2
default/0.0.0.0 0.0.0.0 175.204.18.1 175.204.18.2
196.84.7.0
destination196.84.7.56
196.84.7.0
University of Zagreb, FER SIF 2744, 2008/2009 33 of 48
Routing Example (2)Network dest. Network mask Gateway Interface
196.84.4.0 255.255.255.0 196.84.4.12 196.84.4.12
default/0.0.0.0 0.0.0.0 196.84.4.1 196.84.4.12
Network dest. Network mask Gateway Interface
196.84.7.0 255.255.255.0 196.84.7.3 196.84.7.3
196.84.4.0 255.255.255.0 196.84.4.1 196.84.4.1
default/0.0.0.0 0.0.0.0 196.84.7.1 196.84.7.3
Network dest. Network mask Gateway Interface
196.84.7.0 255.255.255.0 196.84.7.1 196.84.7.1
196.84.4.0 255.255.255.0 196.84.7.3 196.84.7.1
175.204.18.0 255.255.255.0 175.204.18.2 175.204.18.2
default/0.0.0.0 0.0.0.0 175.204.18.1 175.204.18.2
161.68.78.123
161.68.78.0
161.68.78.0
161.68.78.0
`
`
`
175.204.18
196.84.4
175.204.18.2
175.204.18.1
196.84.7.1
196.84.7.3
196.84.4.12
196.84.4.1
196.84.7
destination
University of Zagreb, FER SIF 2744, 2008/2009 34 of 48
Routing Protocols Classification
EGPEGPExterior Gateway ProtocolBorder Gateway Protocol – BGP ◄Exterior Gateway Protocol - EGP
SIF 2744, 2008/2009University of Zagreb, FER 35 of 48
IGPIGPInterior Gateway Protocol
Open Shortest Path First - OSPF◄Routing Information Protocol – RIP ◄
Interior Gateway Routing Protocol - IGRPIntermediate System to Intermediate System (IS-IS)
AS – Autonomous System
AS2
AS3
EGP
IGP
IGPIGP
AS1
2008/2009
Transport Layer
Transport layer functionalityUser Datagram ProtocolTransmission Control Protocol
Transport Layer functionality
♦ enables communication between processesflow multiplexing, i.e. differentiating between data flows belonging to different processes on the same hosttransport layer address is called porttransport layer API (“socket” API)
University of Zagreb, FER SIF 2744, 2008/2009 37 of 48
Transport Layer Protocols in the Internet: TCP and UDP
User Datagram Protocolconnectionless protocolunreliable transferorder not guaranteedno flow controlno congestion controlapplications:
audio, video, internet telephony, teleconferencing (RTP)dynamic address allocation (BOOTP, DHCP)
Transmission Control Protocolconnection-oriented protocolreliable transferordered deliveryflow controlcongestion controlapplications:
web (HTTP)e-mail (SMTP, POP, IMAP)file transfer (FTP)remote terminal (TELNET)
TCP UDP
University of Zagreb, FER SIF 2744, 2008/2009 38 of 48
Transmission Control Protocol (TCP)
♦ specified in RFC 793♦ functionality of TCP
accepts higher layer data, divides the octet stream into segments, and passes them down to the IP layerprovides ordered, reliable delivery of stream of octetsprovides transport layer addressing/multiplexing (ports)
dataTCPIPF
header,20 octets
max. 60 octets
source portsequence number
acknowledgment numberlength
TCP options (optional) padding
higher layer data
destination port
control bits window sizersvd.checksum urgency pointer
TCP segment structure
32 bits
University of Zagreb, FER SIF 2744, 2008/2009 39 of 48
TCP mechanisms
♦ three phases of a connection: connection establishment, data transfer, connection termination
♦ ordered, reliable data delivery over IPdelivers data as a stream of octetsdivides the octet stream into appropriately sized segments Maximum Segment Size (MSS) is determined by the link-layer frame sizeeach segments is numbered
♦ reliability mechanismsacknowledgmentsretransmission
♦ sliding window flow control♦ congestion avoidance
slow start, fast retransmit and fast recovery algorithmsdoing congestion avoidance in TCP is an important design decision of the Internet network
University of Zagreb, FER SIF 2744, 2008/2009 40 of 48
2008/2009
Putting it all together... how an application uses TCP/IP
World Wide Web example
How WWW works, general idea
IP www.fer.hr ?
www.fer.hr161.53.72.111
161.53.72.111browserbrowser
local DNS server
web serverweb
server
Go to:http://www.fer.hr/
SIF 2744, 2008/2009University of Zagreb, FER 42 of 48
diskHTTP request for root index documentHTTP server responds with HTML source
Example: FER Home page
image
form
active element
- menu
text
(css)
University of Zagreb, FER SIF 2744, 2008/2009 43 of 48
Processing of the source HTML code
♦ in this example, HTML code contains references to:CSS layout imagesJavascripttexttext control elements (formatting, hyperlinks, etc.)
♦ all page elements are fetched from the server by using HTTPthe client may start a new HTTP connection, or use the existing one to get the files from the server
<link href="/_themes/metallish/platinum/style.css" rel="stylesheet" type="text/css">
<img src="/shared/images/spacer.gif" height="6" width="1" alt="">
<script type="text/javascript" src="/lib/v1treeview.js"></script>
<p>Svečana promocija pristupnika koji su diplomirali u veljači i ožujku...<p>
<a title="Pročitaj obavijest" href="/?@=1dhtp#news_8980">Više...</a>
University of Zagreb, FER SIF 2744, 2008/2009 44 of 48
Client application requests the image element…
♦ image on the home page must be fetched from the server (HTTP request)
the size of the image file is 16,711 bytes
♦ to be transported over TCP, the image file must be broken into smaller pieces (<=MSS)
transport layer breaks initial 17 kB into 12 TCP segmentsMSS = MTU - size of {IP, TCP} headers = 1500 – 20 – 20 = 1460 byteseach segment is sent to network layer and routed independently
University of Zagreb, FER SIF 2744, 2008/2009 45 of 48
The server application generates the HTTP response…
SIF 2744, 2008/2009University of Zagreb, FER 46 of 48
HTTP
dataHTTPTCPIP
F
dataHTTP
Application layer(HTTP response)
TCP
IP
EthernetdataHTTPTCPIP
MSS MSS MSS *
TCP
... image data ...
... containing the image being delivered to the client ...
Ethernet
dataHTTP TCPTCP
dataHTTPTCPIP IP
F dataHTTPTCPIP
…………….HTTPApplication layer(HTTP response)
... image data ...
University of Zagreb, FER SIF 2744, 2008/2009 47 of 48
... the client collect all elements and displays the Web page.
University of Zagreb, FER SIF 2744, 2008/2009 48 of 48