Upload
dangdien
View
222
Download
0
Embed Size (px)
Citation preview
Introducing the Internet Protocol (IP)
TCP/IP Model review: Layers 1 and 2 Protocols
Figure 8-1 Example LAN/WAN Standards and Types in the TCP/IP Model 2
Introducing the Internet Protocol (IP)
TCP/IP Model review: Upper layers define non-physical (logical) networking functions
Figure 8-2 Various Perspectives on the TCP/IP Model and Roles 3
Introducing the Internet Protocol (IP)
Network Layer protocols IP: Most important protocol defined by Network layer
Almost every computing device on planet communicates, and most use IP to do so
Network layer also defines other protocols
4
Introducing the Internet Protocol (IP) Network Layer protocols: Part 1
Table 8-1 Other TCP/IP Network Layer Protocols
Name Full Name Comments
ICMP Internetwork Control Message Protocol
Messages that hosts and routers use to manage and control packet forwarding process; used by ping command
ARP Address Resolution Protocol
Used by LAN hosts to dynamically learn another LAN host’s MAC address
DHCP Dynamic Host Configuration Protocol
Used by host to dynamically learn IP address (and other information) it can use
DNS Domain Name System/Service
Allows hosts to use names instead of IP address; needs DNS server to translate name into corresponding IP address (required by IP routing process)
5
Introducing the Internet Protocol (IP) Network Layer protocols: Part 2
Table 8-1 Other TCP/IP Network Layer Protocols
Name Full Name Comments
RIP Routing Information Protocol
Application that runs on routers so that routers dynamically learn IP routing tables (used to route IP packets correctly); open standard protocol defined in RFC 2453
EIGRP Enhanced Interior Gateway Routing Protocol
Proprietary routing protocol owned by Cisco Systems
OSPF Open Shortest Path First
Open source routing protocol defined in RFC 2328
6
Introducing the Internet Protocol (IP)
IPv6: Next generation of IP addressing.
Needed because IPv4 addresses exhausted.
128-bit long addresses: 2128 or 3.4x1038 or over 340 undecillion IPs, that’s 340 with 36 zero’s after it.
Customer usually gets /64 subnet, which yields 4 billion times IPs available in all of IPv4.
Comparison: Number of IPv4 addresses equal to weight of cat; number of IPv6 addresses equal to weight of Earth and provides enough IP addresses for every grain of sand on every beach on earth.
7
Introducing the Internet Protocol (IP)
Migration to IPv6 has taken over decade and still in process.
IPv6 originally defined back in mid-1990s.
June 6, 2012 – Was the scheduled IPv6 Day, official worldwide “switch over” day, moved up to February 2012.
Figure 8-3 IPv4 Vs. IPv6 Timeline 8
Introducing the Internet Protocol (IP)
IP defines many functions that work together with one ultimate goal: To send data from one host to another host through any TCP/IP network.
Most important functions include: Creating end-to-end physical paths through TCP/IP network by
interconnecting physical networks (LANs and WANs) using routers
Identifying individual hosts and groups of hosts using IP addressing
Routing (forwarding) IP packets to correct destination host
Figure 8-4 Example of a Post Office Sorting a Letter Sent to Hollywood, California 9
Introducing the Internet Protocol (IP)
IP is like Post Office
Figure 8-4 Example of a Post Office Sorting a Letter Sent to Hollywood, California 10
Introducing the Internet Protocol (IP)
Routers in IP network: Interconnect LANs and WANs via physical connectors called interfaces Example: Cisco 1841 router with two built-in Gigabit Ethernet
LAN interfaces that use RJ-45 connectors
Figure 8-5 Enterprise Class Router, LAN Interfaces, and WAN Interfaces 11
Introducing the Internet Protocol (IP)
IP interconnects LANs and WANs
Figure 8-7 Interconnected LANs and WANs: Redundancy, but No LAN/WAN Detail 12
Introducing the Internet Protocol (IP)
IPv4 Addresses 32 bits Expressed in binary and dotted decimal forms Source and destination IP addresses included in 20-byte IP
header added to all IP packets
Figure 8-8 IPv4 Header Format and Fields 13
Introducing the Internet Protocol (IP)
Converting binary IP address to dotted decimal 1. Separate 32 bits into 4 groups of 8 bits each
2. Do binary-to-decimal conversion of each 8-bit number (each decimal value between 0 and 255)
3. Put period (dot) between each decimal number
Figure 8-9 Generic View of Converting from Binary IP Address to DDN Format 14
Introducing the Internet Protocol (IP)
Example: Converting binary IP address to dotted decimal
Figure 8-10 Converting Binary IP Address to DDN 10.1.2.3 15
Introducing the Internet Protocol (IP): Routing Routing IP Packets from Source to Destination IP addressing groups addresses into networks
All addresses with same value in first parts of addresses considered to be in one network
Example: All addresses that begin with 11, 12, 13, 14, or 15 in that particular network
Figure 8-11 Example IP Address Groupings: All with the Same First Octet in the Same Group 16
Introducing the Internet Protocol (IP): Routing IP routing example with routing tables: PC11 in left LAN
sends IP packet to address 12.1.1.21 (LAN on upper right)
Figure 8-12 Example IP Address Groupings: All with the Same First Octet in the Same Group 17
Introducing the Internet Protocol (IP): Routing Routers build routing tables in two ways Static configuration: Routes entered manually and do not
change
Dynamic routing protocol: Application router uses to automatically learn new routes from other routers
Figure 8-13 Routing Protocols Advertising All Addresses that Begin with 12 as One Route 18
Introducing the Internet Protocol (IP): Other Protocols Domain Name System/Service (DNS): Mapping
names to IP addresses Users use names; IP
routing uses numbers
DNS translates name into corresponding IP address
DNS client sends DNS Request message
DNS server returns DNS Reply
Figure 8-14 DNS Name Resolution Request, Reply, and Packet to Server1 IP Address 19
Introducing the Internet Protocol (IP): Other Protocols
Figure 8-15 IP with its Support Protocols 20
Layer 3 - Network
IP Addressing on User LANs: Network Settings Locations Need IP addresses Each LAN and WAN interface on hosts and routers need IP
address to communicate
Figure 8-17 IP Addresses Used on Every LAN/WAN Interface 21
IP Addressing on User LANs: Network Settings IP Address grouping: Allows IP routing to work better
Routers list one number to represent each network (address group) in routing tables
Figure 8-18 IP Address Groupings: IP Networks 22
IP Addressing on User LANs: Network Settings Original IPv4 RFC defined way to group IPv4 addresses
using IP address classes (classful IP addressing) Every possible IPv4 address falls into class
Table 8-2 Summary of IPv4 Address Classes Based on First Octet Values 23
First Octet Class Purpose 0 A Reserved 1 - 126 A Unicast addresses, in class A networks 127 A Reserved for loopback testing 128 - 191 B Unicast addresses, in class B networks 192 - 223 C Unicast addresses, in class C networks 224 - 239 D Multicast addresses; not used as unicast IP addresses 240 - 255 E Experimental; not used as unicast IP addresses
IP Addressing on User LANs: Network Settings Class A includes lower half of IPv4 address space: All
IPv4 address that begin with first octet between 0 and 127
Table 8-3 Example Class A Networks 24
Network ID Class A IP Network Concept Size (Number of Addresses)
1.0.0.0 All addresses with a first octet equal to 1 > 16,000,000 2.0.0.0 All addresses with a first octet equal to 2 > 16,000,000 3.0.0.0 All addresses with a first octet equal to 3 > 16,000,000 4.0.0.0 All addresses with a first octet equal to 4 > 16,000,000 … Etc…. > 16,000,000 126.0.0.0 All addresses with a first octet equal to 126 > 16,000,000
IP Addressing on User LANs: Network Settings Class B includes ¼ of IPv4 address space with first
octet value from 128 – 191 Includes medium number (216) of medium sized IP
networks for approximately 65,000 hosts per network
Table 8-4 Example Class B Networks 25
Network ID Concept Size (Number of Addresses)
128.1.0.0 All with a first two octets equal to 128.1 > 65,000 128.2.0.0 All with a first two octets equal to 128.2 > 65,000 128.3.0.0 All with a first two octets equal to 128.3 > 65,000 150.48.0.0 All with a first two octets equal to 150.48 > 65,000 180.255.0.0 All with a first two octets equal to 180.255 > 65,000 191.200.0.0 All with a first two octets equal to 191.200 > 65,000
IP Addressing on User LANs: Network Settings Class C includes 1/8th of IPv4 address space with first
octet between 192 and 223 Large number of small IP networks: over 2,000,000 IP
networks, each with 256 IP addresses each
Table 8-5 Example Class C Networks 26
Network ID Concept Size (Number of Addresses)
192.1.1.0 All with a first three octets equal to 192.1.1 254 192.1.2.0 All with a first three octets equal to 192.1.2 254 192.1.3.0 All with a first three octets equal to 192.1.3 254 200.200.200.0 All with a first three octets equal to 200.200.200 254 220.255.0.0 All with a first three octets equal to 220.255.0 254 223.1.1.0 All with a first three octets equal to 123.1.1 254
IP Addressing on User LANs: Network Settings LAN IP address classes summary
Figure 8-20 Summary of How Class Rules Break Down the IPv4 Address Space 27
IP Addressing on User LANs: Network Settings Private addresses: Classful IP networks reserved for
enterprises to use in their network designs Can only be used on local LAN; can’t be routed through
WAN (non-routable) Not regulated by agencies such as ARIN or ICANN
28
Network ID Concept Size (Number of Addresses)
10.x.x.x Class A Private IP addressing space Over 16,000,000 networks of over 16,000,000 IPs each
172.16.x.x – 172.31.x.x
Class B Private IP addressing space Over 65,000 networks of over >65,000 IPs each
192.168.x.x Class C Private IP addressing space Over 65,000 networks of 256 IPs each
IP Addressing on User LANs: Network Settings Static IP address assignment: Manually configured
Figure 8-21 Static IP Address Assignment on Mac OS X 29
IP Addressing on User LANs: Network Settings Most host OS’s allow static configuration of several
network settings
Figure 8-22 Host IP Settings 30
IP Addressing on User LANs: Network Settings Dynamic Host Configuration Protocol (DHCP)
defines way hosts can lease IP address from DHCP network server so does not have to be configured statically Operates on client-server concept
DHCP protocol defined by set of RFCs
Figure 8-23 Sample Network for DHCP Discussions 31
IP Addressing on User LANs: Network Settings Example: IP address assignment design using both
DHCP and statically assigned addresses
Table 8-6 Address Planning: Some Static, Some DHCP, for Every LAN 32
Location Type Range
Atlanta LAN Static 11.1.1.1 - 11.1.1.254 DHCP 11.1.2.1 - 11.1.2.254
Boston LAN Static 172.20.1.1 - 172.20.1.254 DHCP 172.20.2.1 - 172.20.2.254
San Fran LAN Static 172.30.1.1 - 172.30.1.254 DHCP 172.30.2.1 - 172.30.2.254
IP Addressing on User LANs: Network Settings Once DHCP server exists in network and has been
configured with set of IP addresses to lease, DHCP clients can request IP addresses
Figure 8-24 DHCP Lease Process between a DHCP Client and Server 33
IP Addressing on User LANs: Network Settings User can see results of DHCP process from computer
Figure 8-25 DHCP Client Configuration on Mac OS X 34
IP Addressing on User LANs: Network Settings DHCP example: Crossing networks to access DHCP
server
Figure 8-26 Remote DHCP Client in Boston 35
IP Routing with Focus on Layer 3
IP defines how to route packets across TCP/IP network
Some routing tasks must use logic from lower two layers because Network layer (3) cannot physically send bits Network layer relies on
Layers 1 and 2 logic for this
Figure 8-27 IP Routing Perspective, While Ignoring LAN/WAN Details 36
IP Routing with Focus on Layer 3
Router must have IP routing table with useful entries to route IP packets.
Routing table may list multiple routes.
Each IP route identifies network, as well as other information about how to send packets to that network.
Routers look at incoming packet’s destination IP address and compare it to list of network IDs in its routing table to determine where to send packet to destination.
37
IP Routing with Focus on Layer 3
Finding a classful network ID based on IP address
Figure 8-28 Five Classful Networks in a Small Corporate Network 38
IP Routing with Focus on Layer 3
Each route in routing table lists: Information about how
to match IP packets
Forwarding instructions that tell router where to forward packets to (e.g., next router)
Example: R1’s IP routing table shows five network IDs so it knows routes to all five networks
Figure 8-29 R1 Routing Table with Routes for Five Classful Networks 39
IP Routing with Focus on Layer 3
Router compares incoming IP packet’s destination address to information in its routing tables to find best route to destination
Figure 8-30 How Router R1 Uses its IP Routing Table: Match and Forward 40
IP Routing with Focus on Layer 3
Figure 8-31 Routing from End-to-End: Multiple Cooperative Routing Decisions 41
IP Routing with Focus on Layer 3: Subnetting Classful IP networks and wasted IP addresses Subnetting: Process of subdividing network to create smaller
groups of consecutive IP addresses
Subnets (subdivided networks): Smaller groups of addresses
Figure 8-32 Numbers of Classful Networks, and Their Sizes 42
IP Routing with Focus on Layer 3: Subnetting Example: Several subnets created by subnetting network
10.0.0.0
Each subnet has subnet/network ID
Figure 8-33 Subdividing (Subnetting) Class A Network 10.0.0.0 43
IP Routing with Focus on Layer 3: Subnetting Example continued: IP addresses and networks
replaced with five subnets of network 10.0.0.0
Figure 8-34 Sample Corporate Network Using Subnets of Network 10.0.0.0 44
IP Routing with Focus on Layer 3: Subnetting Subnet mask: Shows how much of IP address for each
device is in common to all IPs in subnet Example 255.255.255.0 (/24): First three octets (first 24 bits)
must be equal for all subnets in network
PC11 sends packet to PC21 (destination IP address 10.1.2.21)
R1 will have route for PC21’s subnet (network ID 10.1.2.0)
Figure 8-35 Routing Logic with Subnets and Masks 45
IP Routing with Focus on Layer 3: Subnetting Classful networks have default subnet mask based on
each class Class A: 255.0.0.0 (8 bits)
Class B: 255.255.0.0 (16 bits)
Class C: 255.255.255.0 (24 bits)
If subnet mask anything other than default, then subnetting being used
Figure 8-35 Routing Logic with Subnets and Masks 46
IP Routing with Focus on Layer 3: Subnetting How to calculate subnets
1. Determine network class (A, B, or C) 2. Determine EITHER number of hosts needed for each subnet
OR how many subnets needed 3. Determine how many bits needed to provide correct number of
hosts/subnets; last subnet is NOT usable 4. Calculate IPs for each subnet; first IP identifies subnet (Network
ID) and last IP identifies broadcast address 5. Determine subnet mask (total number of bits for network/subnet
ID)
47
IP Routing with Focus on Layer 3: Subnetting Example: Calculating subnets for network 192.168.12.0 Class: C Number of subnets needed: 14 Number of bits needed to supply 14 subnets: 3 Number of bits left to determine number of IPs per subnet: 5
(results in 32 IPs per subnet) Subnet mask: 255.255.255.224 (default 16 bits + 3 more bits for
subnetting = 19 bits)
48
IP Routing with Focus on Layer 3: Subnetting
49
Subnet No. Network ID Host Range IPs Broadcast IP 0 192.16.12.0 192.16.12.1 – 192.16.12.30 192.16.12.31 1 192.16.12.32 192.16.12.33 – 192.16.12.62 192.16.12.63 2 192.16.12.64 192.16.12.65 – 192.16.12.94 192.16.12.95 3 192.16.12.96 192.16.12.97 – 192.16.12.126 192.16.12.127 4 192.16.12.128 192.16.12.129 – 192.16.12.158 192.16.12.159 5 192.16.12.160 192.16.12.161 – 192.16.12.190 192.16.12.191 6 192.16.12.192 192.16.12.161 – 192.16.12.222 192.16.12.223 7 192.16.12.224 192.16.12.225 – 192.16.12.254 192.16.12.255
IP Routing with Focus on Layer 3: Subnetting What happens when PC11 sends IP packet to PC12:
Same subnet 1. PC11 determines its own
IP address and subnet mask (10.1.1.11 and 255.255.255.0)
2. PC11 decides determines destination is in same subnet
3. PC11 sends packet directly to PC12 without going through router R1
Figure 8-36 IP Host Routing Logic: Local Destination 50
IP Routing with Focus on Layer 3: Subnetting What happens when PC11 sends IP packet to PC12:
Different subnets 1. Host’s default gateway (default router) setting tells it where to
send packets when they have destination address in different subnet
2. Default gateway tells host IP address of router attached to its LAN
3. Router then consults its routing table and determines how to deliver packet
Figure 8-37 IP Host Routing Logic: Remote Destination 51
IP Routing with Layer 1, 2, and 3 Interactions Encapsulation: Action taken by lower layer when it
takes data from higher layer and adds header (and sometimes trailer) to higher layer’s data
Example: PC11 opened web browser and tried to connect to URL at web server: PC11 creating bits it uses to send to server S1 (web server)
Figure 8-38 Encapsulation Review: Application, Transport, and Network Layers 52
IP Routing with Layer 1, 2, and 3 Interactions PC encapsulating IP packet into Ethernet frame (step 4)
Sending bits over LAN cable into network (step 5)
Figure 8-39 Encapsulation Review: Data Link Layer 53
IP Routing with Layer 1, 2, and 3 Interactions De-encapsulation: On the destination side
Figure 8-40 De-encapsulation on a Receiving Host (S1) 54
IP Routing with Layer 1, 2, and 3 Interactions Addressing frames and packets when crossing SAME
subnet: Both MAC and IP addresses in Ethernet frame and encapsulated IP packet
Figure 8-42 IP and Ethernet Addresses, PC11 to server S1, Same Subnet 55
IP Routing with Layer 1, 2, and 3 Interactions To learn destination MAC address, sending device uses
Address Resolution Protocol (ARP) and info in ARP table
Table 8-9 How a Sending IP Host Knows What Addresses to Use
Address Short Answer Long Answer
Source MAC On NIC Given to Ethernet NIC by manufacturer; sending host can find MAC on NIC hardware.
Source IP Configuration Either through static configuration or DHCP
Destination MAC ARP
From its ARP table, or if not found, by using ARP protocol and sending ARP Request and waiting for ARP Reply from destination
Destination IP User Either typed or clicked by user
56
IP Routing with Layer 1, 2, and 3 Interactions Discovering MAC addresses using ARP: ARP Request
and ARP Reply ARP Request (ARP
Broadcast): Sending device queries for MAC address of destination device; sends Request as broadcast to all other devices on subnet
Example: PC11 wants to send packet to server S1 (in same subnet) but does not know S1’s MAC address; PC11 sends ARP Request to all devices on subnet
Figure 8-43 ARP Request (Broadcast) 57
IP Routing with Layer 1, 2, and 3 Interactions ARP Reply: Lists IP address ARP Request asked about
with corresponding MAC address of that host Example: ARP Reply that server
S1 makes in response to PC11’s ARP Request
ARP Reply is unicast since ARP Request generated from one particular device
Figure 8-44 ARP Reply (Unicast) 58
IP Routing with Layer 1, 2, and 3 Interactions Routing data between different subnets IP packets in network act like person traveling to destination,
using all forms of transportation; packet goes from end-to-end
Data Link frames act like individual vehicles used for only part of trip (e.g., just train); frames never leave their own LAN/WAN
Figure 8-45 Example, IP Packet End-to-End, Data Link Heads Stay on LAN or WAN 59
IP Routing with Layer 1, 2, and 3 Interactions Addressing frames and packets when crossing subnets
example: PC11 (10.1.1.11) sends IP packet to PC21 (10.1.2.21) Hosts sit on different LANs (may also be in different subnets)
Figure 8-46 IP Addresses Stay the Same Through End-to-End Path 60
IP Routing with Layer 1, 2, and 3 Interactions Example: PC11 sends IP packet to PC21 PC11’s logic tells it to send packet to default router because
destination is in different network or subnet
PC11 encapsulates packet inside Ethernet frame with destination MAC address R1
Figure 8-47 Ethernet Frames Use MAC on that LAN (Only) 61
IP Routing with Layer 1, 2, and 3 Interactions Removing/adding Data Link headers: Router removes
IP packet from incoming Data Link frame (de-encapsulation) and then adds new Data Link header and trailer before sending packet (encapsulation)
Steps router goes through: 1. De-encapsulates IP packet from inside Data Link frame 2. Makes routing decision using packet’s destination IP address
and its own IP routing table, identifying correct outgoing interface
3. Encapsulates packet into new Data Link frame that works on outgoing interface
4. Sends packet through outgoing interface to destination
Figure 8-48 Routers Discard Old and Add New Data Link Framing 62
IP Routing with Layer 1, 2, and 3 Interactions Example: When R1 receives packet destined to subnet
on R2
Figure 8-48 Routers Discard Old and Add New Data Link Framing 63
IP Routing with Layer 1, 2, and 3 Interactions Using ARP with routers: R2 needs to deliver IP packet
to host PC21 1. R2 builds Ethernet header with
PC21’s MAC address as destination
2. If R2 does not know PC21’s MAC address (i.e., it is not in its ARP table), R2 uses ARP to learn MAC address
3. When R2 receives ARP Reply with PC21’s MAC address, sends frame
Figure 8-49 Example of Router R2 Using ARP to Learn a Local Host’s MAC Address 64
The Internet as a Network of Networks
Figure 9-1 Internet Access Links from TCP/IP Networks, Large and Small 65
The Internet as a Network of Networks
Internet Service Providers (ISPs) create Internet core
Creates physical network for IP packets to travel between enterprises and individual users
Figure 9-2 The Internet Core, with Multiple Service Providers 66
The Internet as a Network of Networks
Connecting enterprises
Figure 9-3 Typical Organizations Whose TCP/IP Networks Connect to the Internet 67
The Internet as a Network of Networks
Connecting to Internet edge: Part of Internet topology between ISP and customer (sits at edge of both networks)
Figure 9-4 Comparing an Enterprise and ISP Network 68
The Internet as a Network of Networks
From network layer perspective: Internet access link acts like any other WAN link between routers
Figure 9-5 T3 Serial Link Connection to the Internet 69
The Internet as a Network of Networks
Securing Internet edge: Enterprises use many security measures and devices to make Internet connection more secure Firewalls Intrusion Prevention Systems (IPS)
Example: Firewall sits in path that all packets take; IPS sits outside path so LAN switch forwards packets to IPS and it analyzes packets and watches for signs of problems
Figure 9-6 An Example Case of Using an Enterprise Firewall and IPS 70
The Internet as a Network of Networks
Typical rules for enterprise firewall A. (Default): Allow inside clients to reach outside
servers in Internet
B. (Default): Disallow outside clients from sending packets to inside servers, unless another rule allows packet
C. (New Rule): Allow outside clients to connect to the two public web servers in DMZ
Example: Two attempts from users in Internet to connect to two different servers in enterprise Figure 9-7 Firewall Allowing Connections to Public Web Servers Only
71
The Internet as a Network of Networks
Each WAN technology creates connection between user’s device and ISP
WAN connection might connect user’s device directly to WAN or may use router (not shown in example)
Figure 9-8 Four Main Options for Individual Internet Access 72
The Internet as a Network of Networks
Connecting Customers to ISP Point-of-Presence (PoP): Each ISP has to create connections Connections between ISP’s customers
and ISP PoP Connections between all ISP’s PoPs
create ISP’s own network and allow all of customers to send packets to one another
Connections to other ISP networks form Internet core which allows all Internet hosts everywhere to send packets to each other
To create effective Internet access service, ISP needs number of PoPs in different locations
Figure 9-9 ISP Point-of-Presence (PoP) Concept with Customer Access 73
The Internet as a Network of Networks
Example: Typical PoP with access routes using direct link to distribution router which connects to rest of ISP’s network
Figure 9-10 Example of Dividing Responsibilities Inside an ISP PoP 74
The Internet as a Network of Networks
Connecting PoPs to create ISP network example ISP might put two more routers at centralized site and use 10-
Gbps Ethernet or SONET equivalent (called OC-192) on all links (center of graphic)
Figure 9-11 Connecting All ISP PoP Routers to Create an ISP TCP/IP Network 75
The Internet as a Network of Networks
ISPs work together to create Internet core
Internet core connects all ISPs to all other ISPs (sometimes directly; sometimes indirectly)
Result: All ISPs can send packets to hosts connected to every other ISP
Figure 9-12 Creating the Internet Core: Connections Between Large ISPs 76
The Internet as a Network of Networks
Tier 2 ISPs rely on connections to Tier 1 ISPs for some of their connections to Internet
Tier 2 ISPs connect to one or more Tier 1 ISPs rather than connecting to ALL Tier 1 ISPs across globe
Figure 9-13 Connectivity Between Tier 1 and Tier 2 ISPs 77
The Internet as a Network of Networks
Other providers of Internet services: Companies who provide services available through Internet Web hosting Search engines Social media Cloud services
Figure 9-14 Other Service Providers Connected to the Internet 78
The Internet as a Network of Networks
Other providers of Internet services Web Hosting: Customer picks URL for its website, creates
content for website, and puts website files onto servers that sit at web hosting company
Search Engine: Computers inside service provider’s network have programs that act like web browsers, systematically getting copy of every web page they can find on Internet
Social Media: Service provider that builds web servers that provide framework for users to add their own content (text, photos, video, apps)
Cloud Services: Large variety of services available through Internet
79
The Internet as a Network of Networks
Web hosting example: Company website (www.example.com) exists on servers owned by web hosting company
When user browses to www.example.com, packets flow to/from servers at web hosting company
Figure 9-15 Hosting a Web Site at a Web Hosting Service, Not in the Enterprise’s IP Network 80
Internet Access Technologies
Phone line and analog modem (Layers 1 and 2) Internet access: When customer calls, Telco passes call to ISP PoP over phone line not being used at moment
Example: Two ISP customers with analog modems If ISP wants to support many concurrent users in PoP, they
need many modems Once dialed in, users’ PCs can send and receive bits with
ISP through R1
Figure 9-16 Two ISP Customers Using Analog Modems and Analog Phone Lines 81
Internet Access Technologies
PPP and DHCP: Together they help customer’s PC learn its public IP address, subnet mask, default gateway, and IP addresses of DNS servers so PCs can access Internet
Figure 9-17 Role of PPP on a Analog Dial-up Circuit to an ISP 82
Internet Access Technologies
Using analog phone lines for Internet access Analog modems use symmetric speeds: Upstream speed (from
customer to ISP) same as downstream speed (from Internet to customer)
For most Internet applications, more bytes flow downstream than upstream
Asymmetric service with faster downstream speeds actually works better
83
Internet Access Technologies
Using analog phone lines for Internet access
Table 9-1 Comparison Points: Analog Modem 84
Name Analog Modem Physical link Telco local loop Always on? No Allows voice at same time over same medium? No Asymmetric? (Faster downlink possible?) No Approximate real-life downlink speeds 56 Kbps
Internet Access Technologies
Digital technologies from Telcos: Integrated Services Digital Network (ISDN) and Digital Subscriber Line (DSL) DSL requires changes to devices at end of local loop cabling,
including device in Telco CO Traditional CO voice
switch does not know what to do with DSL higher frequencies, so CO needs DSL Access Multiplexer (DSLAM) for DSL frequencies
Figure 9-18 DSL Using Multiple Frequencies over a Single Local Loop 85
Internet Access Technologies
Line splitter allows both analog phone and DSL modem to connect to same phone line and transmit simultaneously
Figure 9-19 Home Cabling and Devices for DSL 86
Internet Access Technologies
DSLAM uses Frequency Division Multiplexing (FDM) to separate voice and data frequencies in same electrical signal
DSLAM does not process data or voice; just passes data or voice off to correct device (router or traditional voice switch)
Figure 9-20 DSLAM Multiplexes Voice to the PSTN and Data to the ISP 87
Internet Access Technologies
DSL uses Data Link protocol PPP (Point-to-Point Protocol) to move data (IP packet encapsulated in PPP frame) to DSLAM which then moves PPP frame to ISP router
Figure 9-21 PPP Encapsulated IP Packets Going from Home to ISP Router over DSL 88
Internet Access Technologies
Differences and similarities between analog and DSL modems
Table 9-2 Internet Access Link Comparison Points: Analog and DSL 89
Name Analog Circuit DSL
Physical link Telco local loop Telco local loop
Always on? No Yes Allows voice at same time over same medium?
No Yes
Asymmetric? (Faster downlink possible?)
No Yes
Approximate real-life downlink speeds 56 Kbps 24 Mbps
Internet Access Technologies
Cable TV and cable modem: Cable modem uses different frequency channels than those used for video (TV) Cable Internet
service just like another TV channel
Instead of video, channel sends data
Figure 9-22 Cable Internet Using Multiple Frequencies over a Single Circuit on Co-axial Cable 90
Internet Access Technologies
Cable modem example: Cable modem feed comes from same cable as TV connection
Figure 9-23 Home Cabling and Devices for Cable Internet 91
Internet Access Technologies
Fiber to the Neighborhood (FTTN): Fiber goes to front of neighborhood with coaxial rest of way to houses
Fiber to the Curb (FTTC): Fiber goes into neighborhood and is buried at curb (closer to homes)
Figure 9-24 Hybrid Fiber Coax (HFC) and Fiber-to-the-Curb (FTTC) 92
Internet Access Technologies
Head End: CATV (cable access TV) company’s equivalent of Telco’s Central Office (CO) Has space to hold various devices, including those that
connect to ends of HFC cables
Figure 9-25 CMTS and Head End Multiplexes Video and Data 93
Internet Access Technologies
Differences and similarities between cable Internet, DSL, analog modems
Table 9-3 Internet Access Link Comparison Points 94
Name Analog Circuit DSL Cable Physical link Telco local loop Telco local loop CATV cable Always on? No Yes Yes Allows voice at same time over same medium?
No Yes Yes
Asymmetric? (Faster downlink possible?)
No Yes Yes
Approximate real-life downlink speeds
56 Kbps 24 Mbps 50 Mbps
Internet Access Technologies
Wireless Telco and 4G: Wireless WAN technology supports many devices (mobile phones, tablets, laptops or other computers)
Devices can have built-in wireless WAN card or can use wireless WAN expansion card
Figure 9-26 Wireless WAN Examples 95
Internet Access Technologies
Consumer Internet-access technologies use cabling already in most homes; makes it inexpensive and affordable
Figure 9-27 Enterprise WAN Options Used as Internet Access Technologies 96
Network Layer Concepts Before Scarce IP Addresses Individual IP addresses must be unique to each host
connected to Internet before they can send or receive IP packets
Hosts use IP addresses based on class A, B, or C networks
Addresses can not be assigned randomly
Organized IP addresses helps routers to build usable routing tables of networks Makes routing tables shorter and routing more efficient
97
Network Layer Concepts Before Scarce IP Addresses Many different organizations (typically part of some not-
for-profit organization) work together to assign IP addresses for Internet worldwide IANA: Part of ICANN (Internet Corporation for Assigned Names
and Numbers) works with five worldwide regional organizations to manage address assignment process
Table 9-4 Regional Internet Registries (RIRs) 98
Name Locations Served AfriNIC Africa APNIC Asia Pacific ARIN North America LACNIC Latin America, Caribbean RIPE NCC Europe, Middle East, Central Asia
Network Layer Concepts Before Scarce IP Addresses Early days of Internet: Original rule for assigning
addresses was for each company to use one classful IP network for its network When company wanted to
connect to Internet, it applied to IANA for classful network
IANA reviewed application and assigned network ID
Figure 9-29 IANA Assigned Classful IP Network Numbers 99
Network Layer Concepts Before Scarce IP Addresses IANA IP network assignments followed these general
rules: 1. Only assign network IDs not yet
assigned to any other enterprise 2. Assign class of network just large
enough to meet need of enterprise
At end of process, each enterprise had public address that fell into class A, B, or C IP address from public network
could be used to send packets to any other network in Internet
Figure 9-30 Enterprises Subnet their One Classful IP Network 100
Network Layer Concepts Before Scarce IP Addresses Example of SOHO address assignment in early days:
ISP1 reserved class C network 200.2.2.0 When PC2 and PC3 connect to ISP, they are given addresses
by ISP1 router
Figure 9-31 Assigning IP Addresses to SOHO PCs 101
Network Layer Concepts Before Scarce IP Addresses Border Gateway Protocol (BGP): Internet IP routing
protocol Prefers routes through less
expensive links
Creates large routing tables
Figure 9-32 BGP: Choosing Routes (Indirectly) Based on Business Rules 102
Network Layer Concepts Before Scarce IP Addresses In Internet core, routing tables have grown to over
400,000 routes
So BGP built to be better able to handle larger numbers of routes
Figure 9-33 Scale of Internet Routing Tables: Large Enterprise Vs. Internet Core Routers 103
Network Layer Concepts Before Scarce IP Addresses Once classful network
has been assigned to company, all routers in Internet core need to know how to forward packets so they can reach ISP connected to company
Figure 9-34 Internet Routing: IP Routes to Each Classful IP Network 104
Network Layer Concepts Before Scarce IP Addresses Routers receive packets and then send them to next
router
Figure 9-35 IP Forwarding (Routing) on Several ISP Routers 105
Network Layer Concepts Before Scarce IP Addresses Single-homed connection means that enterprise has
only one WAN link connecting to ISP
Figure 9-36 Single-Homed Connection with Default Route 106
Network Layer Concepts Before Scarce IP Addresses Dual-homed Internet connection means enterprise has
two (or more) connections to Internet
Gives enterprise choice of where to send Internet packets
Default route might not work well in such network designs
Figure 9-37 Inefficient Routes With Dual-homed Internet Connections 107
Network Layer Concepts Before Scarce IP Addresses Dual-homed example: Enterprise uses BGP between
itself and both ISP1 and ISP2
ISP2’s router would advertise routes for networks 22.0.0.0 and 23.0.0.0, and routers R1 and R2 view route to Internet through ISP2 as better route
Figure 9-38 Partial BGP Updates 108
Network Layer Concepts Before Scarce IP Addresses Example: User device connects to Internet without
using router Host has OS that includes TCP/IP software
IP software includes concept of default router
When connected to Internet, host’s default router setting refers to ISP router
Figure 9-39 Default Routers and Default Routes 109
Network Layer Concepts Before Scarce IP Addresses Name resolution and Global DNS system: Creating
globally unique hostnames
DNS names assigned by IANA
Process for how companies and individuals get and use hostnames in Internet similar to assigning IP addresses
Figure 9-40 Review: IANA Assigns IP Networks 110
Network Layer Concepts Before Scarce IP Addresses To create globally unique hostnames, process relies on
domain names
With this format, names exist as characters with periods in between
Subdomain: Last part of name
Figure 9-41 Format and Examples Using Domain Names 111
Network Layer Concepts Before Scarce IP Addresses To ensure unique hostnames throughout Internet,
company or individual must register subdomains with IANA-authorized company
If requested name not already in use, agency registers name so no other entity can use it
Figure 9-42 IANA/Others Approve Subdomain Registrations 112
Network Layer Concepts Before Scarce IP Addresses Hostnames on LANs follow domain name format, too
Administrative process ensures no two hostnames will ever be same
Enterprises must not duplicate names inside company
Figure 9-43 IANA/Others Approve Subdomain Registrations 113
Network Layer Concepts Before Scarce IP Addresses Example: Name server for companies Ent-1, Ent-2, and
Ent-3 In each case, name server
lists short version of name, along with IP address used by that host
Name server considers each short name to have correct subdomain at end of name
Figure 9-44 DNS Servers and Distributed Server Configurations 114
Network Layer Concepts Before Scarce IP Addresses DNS defines how world creates distributed database of
hostnames and their addresses DNS server for each subdomain
knows all hostnames and IP addresses for that subdomain
Root DNS servers: Special DNS servers inside Internet know IP addresses of all DNS servers
DNS defines protocol that servers use to ask among all DNS servers to find DNS server for right subdomain
Figure 9-45 Finding the Right DNS Server for a Domain Name in Another Company 115
Network Layer Concepts Before Scarce IP Addresses At this point, client does not yet know www.ent-1.com’s
IP address Step 5: Server 128.1.9.9 sends name
resolution request to DNS for subdomain server ent-1.com
Step 6: DNS server ent-1.com knows name “www.ent-1.com,” so replies with IP address 1.1.1.1
Step 7: DNS server replies to Client A with IP address of 1.1.1.1 so Client can now send packet with correct IP address on it
Figure 9-46 Getting a Response from the Authoritative DNS Server for Ent-1.com 116
Network Layer Concepts with Scarce IPv4 Addresses IPv4 address exhaustion Became clear by late 1980s that world would run out of IPv4
addresses with current IP class plan
Original address assignment plan had problems in part because of sizes of classful IP networks and number of each that existed
Table 9-4 Number and Sizes of Classful IP Networks 117
Class Number of Networks
Size (Number of Host Addresses)
A 126 224 – 2 (>16,000,000) B 16,384 216 – 2 (>65,000) C 2,097,192 28 – 2 (254)
Network Layer Concepts with Scarce IPv4 Addresses Example of IP address assignment: Enterprise asks for
Class B network from IANA IANA grants network
128.1.0.0
Internet routers update routing tables with routes for 128.1.0.0; entire class B network must be in one place
Figure 9-47 Wasted IP Addresses: Got 65,000, Need 500 118
Network Layer Concepts with Scarce IPv4 Addresses Graph: Number of estimated
Internet hosts 1984 – 1992
Data derived primarily from RFC 1296, which collected growth data in part because of IP address exhaustion problem
Figure 9-48 Approximate Number of Hosts Connected to the Internet, 1984 - 1992 119
Network Layer Concepts with Scarce IPv4 Addresses Classless Interdomain Routing (CIDR): One method to
deal with IP address depletion
Used by IANA
Each CIDR block is set of consecutive IP addresses unique in Internet (same as classful IP networks)
Figure 9-49 IANA Assigns to ISP; ISP Assigns Smaller CIDR Block to Customer 120
Network Layer Concepts with Scarce IPv4 Addresses CIDR reduces routing table growth with route
aggregation Example: ISP1 has 3 customers, each of which has CIDR block
of public IP addresses
Router R4 (part of ISP1’s network) has routes for each customer’s CIDR block
Figure 9-50 CIDR Address Assignment Creates Larger Routing Tables 121
Network Layer Concepts with Scarce IPv4 Addresses Route aggregation requires worldwide IP address
assignment process to assign numbers in large, consecutive groups Large group first assigned
to large enterprise such as ISP
Then ISP assigns smaller CIDR blocks to its customers
Administrative process allows routers to create aggregate routes for original large blocks, rather than separate routes for each individual smaller block
Figure 9-51 CIDR Route Aggregation Keeps Other ISP Routing Tables Smaller 122
Network Layer Concepts with Scarce IPv4 Addresses Network Address Translation (NAT): Way to translate
multiple PRIVATE addresses to single PUBLIC address for Internet access
Figure 9-52 Hosts with Public IP Addresses Connected to Servers in the Internet 123
Network Layer Concepts with Scarce IPv4 Addresses Three different connections from one host Server maps IP address for each connection
Figure 9-53 One Client Host with Three Application Connections 124
Network Layer Concepts with Scarce IPv4 Addresses NAT combines connections into one Example: Three real devices each connect to same real web
server Router implementing NAT makes all three connections look like
they come from single host (128.1.1.4)
Figure 9-54 NAT Function on a Router 125
Network Layer Concepts with Scarce IPv4 Addresses Example using private and public IP addresses Three separate enterprises use PRIVATE networks based on
10.0.0.0
Each company uses different PUBLIC IP address block to access Internet
Figure 9-55 Three Enterprises Networks, Each Using Private Network 10.0.0.0 126
Network Layer Concepts with Scarce IPv4 Addresses Public and private IP addresses: RFC 1918 sets aside
several private IP network address blocks
Enterprise can pick private address block, assign IP addresses from that block, subnet that block, etc.
Table 9-5 Private IP Networks 127
Class Number of Networks
Network IDs
A 1 10.0.0.0 B 16 172.16.0.0 - 172.31.0.0
C 256 All that begin 192.168 (192.168.0.0, 192.168.1.0, 192.168.2.0, and so on, through 192.168.255.0)
Network Layer Concepts with Scarce IPv4 Addresses Basic NAT mechanics: NAT translates (changes) IP
addresses inside IP headers as packets pass through device doing NAT Step 1: PC sends
packet to router
Steps 2-3: Router translates private IP to public IP
Step 4: Router sends updated packet to public Internet
Figure 9-56 NAT Translating the Source Address in Packet from Inside to Outside 128
Network Layer Concepts with Scarce IPv4 Addresses NAT example, Part 2: Server replies to host Packet comes into NAT router with IP address of 200.1.1.1
Step 6: Router consults its NAT table to translate packet’s address to Client A’s IP address (10.1.1.1)
Step 7: Router forwards packet to Client A
Figure 9-57 NAT Translating the Destination Address in Packet from Outside to Inside 129
Network Layer Concepts with Scarce IPv4 Addresses Enterprise still needs some public IP addresses so can
access Internet and be accessible by users outside enterprise (e.g., for web services) 1. For NAT devices
2. For hosts in enterprise that need static, public IP addresses (typically servers)
Figure 9-58 Public and Private IP Addresses in the Enterprise 130
Network Layer Concepts with Scarce IPv4 Addresses SOHO address assignment: Most SOHO connections to
Internet use small, consumer-grade routers that typically combine many functions into one device
Figure 9-59 Various Roles of Consumer “Router” 131
Network Layer Concepts with Scarce IPv4 Addresses Router typically has defaults such as Dynamically uses one public IP address (from ISP) on WAN
port Uses that one public IP for NAT Makes WAN port “outside” port for NAT Processes traffic coming in from LAN ports with NAT Picks one private IP network to use on LAN (typically
192.168.1.0) Acts as DHCP server on LAN ports to lease IP addresses to all
hosts on LAN Acts as firewall, allowing Intranet clients to connect to Internet
and preventing Internet clients from getting onto Intranet
Figure 9-59 Various Roles of Consumer “Router” 132
Network Layer Concepts with Scarce IPv4 Addresses Example SOHO address assignment
User can change router defaults or use directly out of box as is
Figure 9-60 Default Settings on a Consumer-Grade Integrated Router 133
Transport and Application Protocols
TCP/IP Transport: TCP/IP model’s two upper layers (Application and Transport) define how applications communicate and other important features of what applications can do on network
Transport and Application Layers focus on hosts
Figure 10-1 Scope of Impact for TCP/IP Layers 134
Transport and Application Protocols
Host perspectives on upper layers: Upper layer protocols exist in both application and OS
Application developers include Application layer protocol in application (e.g., Telnet)
OS vendor includes Transport protocol inside OS (e.g., IE in Windows)
Figure 10-2 Software Architecture of Application and Transport Layers 135
Transport and Application Protocols
Serving needs of next higher Layer: On hosts, each function has needs and supplies answer to needs of other functions
Example: Web browser Application needs to get web page;
Application protocol takes care of it using browser application and HTTP does that by using HTTP GET command
Figure 10-3 Needing and Supplying Services in TCP/IP Upper Layers 136
Transport and Application Protocols
Encapsulation and headers: Application and Transport layer protocols use headers to do their work
Application protocol on sending host adds Application protocol header that destination host’s Application layer protocol reads
Transport layer adds headers based on protocol used: TCP or UDP
137
Transport and Application Protocols
UDP header format
TCP header format
Figure 10-4,5 UDP/TCP Header Reference 138
Transport and Application Protocols
Sending host adds original Application and Transport layer header to data to create message; upper layer messages remain mostly unchanged as they pass through network
Example: Message from web server going the web browser; message shows TCP, HTTP, Data Link, and IP headers plus data going through route from host to host
Figure 10-6 Encapsulation with Web Traffic, All Layers 139
Transport and Application Protocols
Applications and their preferred Transport protocols
Figure 10-8 Some Applications Using TCP, and Some Using UDP 141
Transport Layer Concepts
Elements of Transport Protocols Addressing
Connection Establishment
Connection Release
Flow Control and Buffering
Multiplexing
Crash Recovery
Figure 10-3 Needing and Supplying Services in TCP/IP Upper Layers 142
Transport Layer Concepts
TCP: Reliable, in-order delivery Congestion control
Flow control
Connection setup
UDP: Unreliable, unordered delivery No-frills, “best-effort” delivery
Delay guarantees
Bandwidth guarantees
Figure 10-3 Needing and Supplying Services in TCP/IP Upper Layers 143
Transport Layer Concepts
Connection establishment using three-way handshake CR = CONNECTION REQUEST (a) Normal operation (b) Old CONNECTION REQUEST appearing out of nowhere (c) Duplicate CONNECTION REQUEST and duplicate ACK
144
Transport Layer Concepts
Connection release (a) Normal case of three-way handshake release
(b) Error case: Final ACK lost
145
Transport Layer Concepts
Flow control: “Window” can dynamically resize According to network conditions
According to sender’s capacity
According to receiver’s capacity
http://wiki.treck.com/File:Fig1.40_Using_a_Sliding_Window_Protocol.gif 146
Transport Layer Concepts
Buffering (a) Chained fixed-
size buffers
(b) Chained variable-sized buffers.
(c) One large circular buffer per connection
147
Transport Layer Concepts
Multiplexing Multiplexing at sender: Handles data from multiple sockets,
adds transport header (later used for demultiplexing) Demultiplexing at receiver: Uses header info to deliver received
segments to correct socket
148
Transport Layer Port Numbers
Most host OSs allow multiprocessing which allows more than one program to be active at same time
Each active program gets share of CPU and RAM with all programs taking turns
Transport of data packets similar Protocol
identifies correct application process on destination host and uses port to identify communication session
Figure 10-9 Concept of Application-to-Application Flows Between Two Apps 150
Transport Layer Port Numbers
Port numbers identify application processes
Example: 3 TCP communication sessions with TCP port numbers; Both hosts are using TCP port 1024 so have to use different TCP port numbers to identify separate communication sessions
Figure 10-10 Three TCP Flows with Unique TCP Ports per Host 151
Transport Layer Port Numbers
Port numbers need to be unique on each source host because of how TCP uses destination port number
Example: Right shows destination host’s TCP software; when top segment arrives (destination port 80), Host2 looks at its list of active TCP ports to find port 80
Figure 10-11 Destination Host Chooses Right Destination Application Based on Destination Port 152
Transport Layer Port Numbers
Initializing servers with well known ports example: Two server software processes (web server and email server) Web server uses HTTP (Application protocol) which uses
default port of 80
Email server uses POP3 (Application protocol) which uses port 110
Figure 10-12 Two Servers with Well-Known Ports Open and Listening for New Connections 153
Transport Layer Port Numbers
What happens on server when server software registered to use specific port number?
Example using web server: Software uses its default setting to use port for HTTP: TCP port 80
Figure 10-13 Server Initializing Well-Known Port 80 for HTTP 154
Transport Layer Port Numbers
Web browser software knows web servers should use port 80 by default
Email client software knows that POP3 servers use TCP port 110 by default
Figure 10-14 Clients Send TCP Segments to Correct Well-Known Port Numbers 155
Transport Layer Port Numbers
Table 10-1 Common Application Protocols and Their Well-known Port Numbers
Application Protocol
Transport Protocol
Port Number
Description
HTTP TCP 80 Used by web browsers and web servers Telnet TCP 23 Used for terminal emulation SSH TCP 22 Used for secure terminal emulation FTP TCP 20, 21 Used for file transfer DNS UDP 53 Used for name-to-IP resolution SMTP TCP 25 Used to send Email POP3 TCP 110 Used to receive Email IMAP TCP 143 Used to receive Email SSL TCP 443 Used to encrypt data for secure transactions SNMP UDP 161, 162 Used to manage TCP/IP networks
156
Transport Layer Port Numbers
Dynamically allocated port
Figure 10-15 Client Initializing a Dynamic Port Number Assigned by OS (TCP) 157
Transport Layer Port Numbers
Dynamic port assignment on client computer when user opens web browser
Figure 10-16 Client Initializing a Dynamic Port Number Assigned by OS (TCP) 158
Transport Layer Port Numbers
IANA regulates range of numbers for well known ports, dynamic ports, and registered ports
Ranges apply to both TCP and UDP
Table 10-2 Well-known, Registered, and Dynamic Port Numbers
Type Port Number Range Well-known 0 - 1023 Registered 1,024 – 49,151 Dynamic 49,153 – 65,535
159
Transport Layer Port Numbers
To deliver data, TCP encapsulates data inside TCP segment
Segment lists source port and destination port
To begin communication process, servers initialize and start listening for new sessions from clients
Figure 10-17 Email and Web Servers Waiting for Flows 160
Transport Layer Port Numbers
Example: Client opens web browser to connect to web server which creates multiple TCP sessions
Client needs three TCP port numbers, one per session
User also checks his email which creates fourth TCP session
Figure 10-18 Four Flows with (Dynamic) Source Ports and Well-Known Destination Ports 161
Transport Layer Port Numbers
Four returning messages with their respective port numbers
Figure 10-19 Port Numbers Reversed for TCP Segments in the Opposite Direction 162
Other Transport Functions: Segmentation
Packets restricted for size in TCP/IP network so use segmentation to break large data packages into smaller pieces
Maximum Transmission Unit (MTU): Maximum size of IP packet that can be sent out network device interface (e.g., router) Based on interface’s
Data Link protocol; example: Ethernet has MTU of 1500 bytes for TCP
Figure 10-20 IP MTU Concept on Ethernet Links 163
Other Transport Functions: Segmentation
IP fragmentation and TCP segmentation play important roles in TCP/IP networks TCP on sending host breaks large data “chunks” into smaller
pieces when creating original TCP segments
TCP segmentation example: Web server needs to send web object (picture.jpg) which is 14,600 bytes
File size exactly 10 times MSS on server’s Ethernet interface so divided into 10 segments for transport
Figure 10-21 Web Server Sends Web Object; TCP Segments 164
Other Transport Functions: Segmentation
UDP datagram: UDP messages that include UDP header and its encapsulated data
UDP also needs to segment data: Limited to maximum size of each link
Example: UDP datagram MTU 1472 bytes on Ethernet link
Figure 10-22 UDP Datagram Maximum Data Size on Ethernet Links 165
Other Transport Functions: Connection Management TCP guarantees delivery and has error recovery built in
(connection-oriented)
To confirm destination received data, TCP uses acknowledgments for each segment received with no errors Example: Web server sends three TCP segments to web
browser with sequence numbers (SEQ); client sends message back to server (ACK) stating all three segments received and to send next set of segments
166
Other Transport Functions: Connection Management When using TCP, sender/receiver perform “handshake”
before exchanging data Agree to establish connection (each knowing other willing to
establish connection)
Agree on connection parameters
Figure 10-23 TCP Sequence Numbers and Acknowledgement Concepts 167
Other Transport Functions: Connection Management Three-way handshake
SYNbit=1, Seq=x
choose init seq num, x send TCP SYN msg
ESTAB
SYNbit=1, Seq=y ACKbit=1; ACKnum=x+1
choose init seq num, y send TCP SYNACK msg, acking SYN
ACKbit=1, ACKnum=y+1
received SYNACK(x) indicates server is live; send ACK for SYNACK;
this segment may contain client-to-server data received ACK(y)
indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state LISTEN
server state LISTEN
168
Other Transport Functions: Connection Management Congestion control: Too many sources sending too
much data too fast for network to handle
Different from flow control!
Manifestations Lost packets (buffer overflow at routers)
Long delays (queuing in router buffers)
169
Other Transport Functions: Connection Management UDP: Connectionless protocol Does not use acknowledgements
Does not use sequencing
Will not retransmit missing datagrams
Considered less reliable than TCP
Has much less overhead than TCP
Much faster than TCP
170
Other Transport Functions: Error Recovery
TCP error recovery uses SEQ and ACK packets 1. Data sent from source in TCP segments with sequence numbers
2. Source expects to receive ACK from destination with next sequence number
3. If source does not receive ACK with expected value or receives no ACK at all in reasonable time, retransmits TCP segments
171
Other Transport Functions: Error Recovery
When receiving host gets some, but not all segments, can send back ACK but with value that tells sender to retransmit some data
Example: Second TCP segment has bit errors that occurred during its trip through network so destination router discards TCP segment
Figure 10-24 An Example with an Error; the Recovery Happens Later 172
Comparing TCP and UDP
TCP RFCs: 793,1122,1323, 2018, 2581 Point-to-point: One sender, one receiver Reliable, in-order byte steam: No “message boundaries” Pipelined: TCP congestion and flow control set window size
Full duplex data Bi-directional data flow in same connection MSS: Maximum segment size
Connection-oriented: Uses handshaking Flow controlled: Sender will not overwhelm receiver
173
Comparing TCP and UDP
UDP does NOT guaranteed delivery (connectionless) so Application protocols that do not need guaranteed delivery use UDP
Gives Application protocol designers option for less overhead
UDP header smaller than TCP headers
UDP also faster as it does not stop and wait for acknowledgements of delivery
174
Comparing TCP and UDP
Common features Both connect applications
Both provide service so application can send data to correct application on destination host
Both use port numbers in their headers
Differences TCP has more functions, but slower because of them
UDP faster due to less overhead, but fewer functions including no error recovery
175