Download Document

Document related concepts
no text concepts found
Transcript
TCP/IP Internetworking
Chapter 8
Recap
• Single Networks (Subnets)
– Chapters 4 and 5 covered single LANs
– Chapters 6 and 7 covered residential Internet access
and single WANs
• Internets
– Connect multiple single networks using routers
– 70%-80% of internet traffic follows TCP/IP standards
– These standards are created by the IETF
– Chapter 10 looks in more detail at TCP/IP
management
8-2
Figure 2-8: Hybrid TCP/IP-OSI Architecture
Recap
Specific Purpose
General Purpose
Layer
Application-application
communication
Application (5)
Application-application
interworking
Transmission across an
internet
Transport (4)
Host-host
communication
Internet (3)
Packet delivery across
an internet
Data Link (2)
Frame delivery across a
network
Transmission across a
single network (LAN or
WAN)
Physical (1)
Device-device
connection
TCP/IP standards dominate at the
internet and transport layers—
transmission across an internet
8-3
Figure 2-11: Internet and Transport Layer, Cont.
Recap
Client PC
Transport Layer
end-to-end (host-to-host)
TCP is connection-oriented, reliable
UDP is connectionless and unreliable
Server
Internet Layer
(usually IP)
hop-by-hop (host-router or router-router)
connectionless, unreliable
Router 1
Router 2
Router 3
8-4
Frames and Packets
Recap
• Messages at the data link layer are called frames
• Messages at the internet layer are called packets
• Within a single network, packets are encapsulated
in the data fields of frames
Frame
Trailer
Packet
(Data Field)
Frame
Header
8-5
Frames and Packets
Recap
• In an internet with hosts separated by N
networks, there will be:
– 2 hosts
– One packet (going all the way between hosts)
• One route (between the two hosts)
– N frames (one in each network)
8-6
Figure 2-21: Combining Horizontal and Vertical
Communication
Recap
App
Transmission Control Protocol (TCP)
Or User Datagram Protocol (UDP)
Trans
Int
Trans
Internet Protocol
(IP)
Int
IP
Router
1
Switch
3
Int
Int
DL
Phy
Source
Host
Switch
1
Switch
2
Router Destination
Host
2
8-7
Figure 8-1: Major TCP/IP Standards
User Applications
5 Application
HTTP
4 Transport
3 Internet
2 Data Link
SMTP
Many
Others
Supervisory Applications
DNS
TCP
IP
Routing Many
Protocols Others
UDP
ICMP
MPLS
ARP
None: Use OSI Standards
1 Physical
None: Use OSI Standards
Internetworking is done at the internet and transport layers.
There are only a few standards at these layers.
We will look at the shaded protocols in this chapter.
8-8
Figure 8-1: Major TCP/IP Standards, Continued
User Applications
5 Application
HTTP
4 Transport
3 Internet
2 Data Link
SMTP
Many
Others
TCP
Supervisory Applications
DNS
Routing Many
Protocols Others
UDP
IP
ICMP
ARP
None: Use OSI Standards
1 Physical
Use OSI
At the None:
application
layer,Standards
there are
user applications and supervisory applications.
We will look at two TCP/IP
application layer supervisory applications in this chapter.
8-9
IP Addresses
32-Bit Strings
Dotted Decimal Notation for Human Reading
(e.g., 128.171.17.13)
Figure Figure
8-3:8-3:Hierarchical
IP Address
Hierarchical IP Address
Network Part (not always 16 bits)
Subnet Part (not always 8 bits)
Host Part (not always 8 bits)
Total always is 32 bits
128.171.17.13
The Internet
UH Network (128.171)
IP addresses are not
simple 32-bit numbers.
They usually have 3 parts.
Consider the example
128.171.17.13
Host 13
CBA Subnet (17)
8-11
Hierarchical Addressing
• Hierarchical Addressing Brings Simplicity
– Phone System
• Country code-area code-exchange-subscriber
number
• 01-808-555-9889
– Long-distance switches near the top of the hierarchy
only have to deal with country codes and area codes to
set up circuits
– Similarly, core Internet routers only have to consider
network or network and subnet parts of packets
8-12
Router Operation
Figure 8-4: Border Router, Intrernal Router,
Networks, and Subnets
Figure 8-4: Border Router, Internal Router, Netw orks, and Subnets
Subnet 192.168.2.x
Internal
Router
Subnet 192.168.3.x
Subnet
192.168.1.x
Corporate
Network
192.168.x.x
Border
Router
ISP Network
60.x.x.x
Border routers connect different Internet networks
(In this case, 192.168.x.x and 60.x.x.x).
An “x” indicates anything.
8-14
Figure 8-4: Border Router, Internal Router,
Networks, and Subnets
Figure 8-4: Border Router, Internal Router, Netw orks, and Subnets
Subnet 192.168.2.x
Internal
Router
Subnet 192.168.3.x
Subnet
192.168.1.x
Corporate
Network
192.168.x.x
Border
Router
ISP Network
60.x.x.x
Internal routers connect different subnets in a network.
In this case, the three subnets are boxed in red:
192.168.1.x, 192.168.2.x, and 192.168.3.x.
8-15
Figure 8-5:
Multiprotocol Routing
Figure 8-5: Multiprotocol Routing
Site B
Site A
UNIX
Server
Ethernet
LAN 2
Ethernet
LAN 1
Edge Mainframe
IPX/
SNA
Old
Router
NetWare SPX
Z
Server TCP/
IP
Multiprotocol
Router
The Internet
TCP/
X
Ethernet
IP
Lan 3
Internal
Router
Real routers
must handle multiple
Y layer architectures—
internet and transport
WWW
Server
TCP/IP, IPX/SPX, SNA, etc.
We will only look at TCP/IP routing
8-16
Figure 8-6: Ethernet Switching Versus IP Routing
Ethernet Switching
Switch
2
Destination address is E5-BB-47-21-D3-56.
Port 7 on Switch 2
5 on are
Switch
1
EthernetPort
switches
arranged
in a hierarchy.
tohosts.
Port 4 on Switch 3
Port one
3 onpossible
Switch path
2 between
So there to
is only
So only one row can match an Ethernet address.
Finding this row is very simple and fast.
Switching
Table Switch 1
So Ethernet switching is inexpensive per frame
handled.
Switch
1
A1-44-D5-1F-AA-4C
Switch 1, Port 2 B2-CD-13-5B-E4-65
Switch 1, Port 7
Port
2
7
5
5
5
Station
A1-44-D5-1F-AA-4C
B2-CD-13-5B-E4-65
C3-2D-55-3B-A9-4F
D4-47-55-C4-B6-9F
E5-BB-47-21-D3-56
One Correct Row
8-17
Figure 8-6: Ethernet Switching Versus IP Routing
Router
RoutingA
Interface
1
Router B
IP Routing
Packet to 60.3.47.129 Interface
2
Network
60.x.x.x
Routing Table for Router A
Matches
IP Address
Next-Hop
Route
Range Metric Router
Router C
Network
1
60.3.x.x
9
B
60.3.x.x
2 128.171.x.x 2
B
3
60.3.47.x
8
C
Host
Host
4
10.5.3.x
6
B
60.3.45.129
60.3.47.x
5 128.171.17.x 2
Local
6 of10.4.3.x
2
C
Because
multiple alternative
routes in router meshes,
routers may have several rows that match an IP address.
Routers must find All matches and then select the BEST ONE.
This is slow and therefore expensive compared to switching.
8-18
Figure 8-7: The Routing Process
• Routing
– Processing an individual packet and passing it on its way
is called routing
• Router ports are called interfaces
• Packet arrives in one interface
• The router sends the packet
out another interface
8-19
Figure 8-7: The Routing Process
• The Routing Table
– Each router has a routing table that it uses to make
routing decisions
– Routing Table Rows
• Each row represents a route for a RANGE of IP
addresses—often a network or subnet
• All packets with addresses in this range are routed
according to that row
Route
IP Address Range
Governed by the route
Metric
Next-Hop
Router
1
60.3.x.x
9
B
8-20
Figure 8-7: The Routing Process
• The Routing Table
– Routing Table Columns
• Row (route) number: Not in real routing tables
• IP address range governed by the row
• Metric for the quality of the route
• Next-hop router that should get the packet next if the
row is selected as the best match
Route
IP Address
Range
Metric
Next-Hop
Router
1
2
60.3.x.x
128.171.x.x
9
2
B
B
8-21
Figure 8-7: The Routing Process
• A Routing Decision
– The router looks at the destination IP address in an
arriving packet (in this case, 60.3.47.12).
– 1. The router determines which rows match (have an IP
address range containing the packet’s destination IP
address)
• The router must check ALL rows for possible matches
Route
IP Address
Range
Metric
Next-Hop
Router
Arriving Packet
60.3.47.12
1
2
60.3.x.x
128.171.x.x
9
2
B
B
Match
No Match
8-22
Figure 8-7: The Routing Process
• A Routing Decision
– 2. After finding all matches, the router then determines
the BEST-MATCH row
• 2A. Selects the row with the LONGEST MATCH
– 60.3.x.x has 16 bits of match
– 60.3.47.x has 24 bits of match so is a better match
• 2B. If two or more rows tie for the longest match,
router uses the METRIC column value
– If cost, lowest metric value is best
– If speed, highest metric value is best
– Etc.
8-23
Figure 8-7: The Routing Process
• A Routing Decision
– 3. After selecting the best-match row, the router sends
the packet on to the next-hop router indicated in the
best-match row—Next-Hop Router B in this example.
Route
IP Address
Range
Metric
Next-Hop
Router
1
2
60.3.x.x
128.171.x.x
9
2
B
B
Send Packet
out to
NHR B
Best-Match Row
8-24
Box
A More Detailed Look at
Routing Decisions
Figure 8-8: Detailed Row-Matching Algorithm
Box
• Routing Table
IP Address Range
Row
Destination
Mask
…
…
…
1
10.7.3.0
255.255.255.0
…
…
…
2
…
…
…
…
…
Actually, the table does not really have an “IP Address Range” column.
3Instead, it has…
… the IP address
…
…
two columns to indicate
range:…
Destination (an IP address) and a mask
8-26
Figure 8-8: Detailed Row-Matching Algorithm
Box
• 1. Basic Rule of Masking
– Information Bit
1 0 1 0
– Mask Bit
1 1 0 0
– Result
1 0 0 0
• Where mask bits are one, the result gives the
original IP address bits
• Where mask bits are zero, the result contains zeros
8-27
Figure 8-8: Detailed Row-Matching Algorithm
Box
• 2. Example
– Address (partial)
10101010
11001110
– Mask
11111000
00000000
– Result
10101000
00000000
8-28
Figure 8-8: Detailed Row-Matching Algorithm
Box
• 3. Common 8-bit Segment Values in Dotted
Decimal Notation
– Segment
Decimal Value
00000000
0
11111111
255
• 4. Example
– 255.255.255.0 is 24 ones followed by 8 zero
– 255.255.255.0 is also called /24 in “prefix notation”
8-29
Figure 8-8: Detailed Row-Matching Algorithm
Box
Row
Destination
Mask
…
…
…
1
10.7.3.0
255.255.255.0
…
…
…
• Example 1: A Destination IP Address that is in the Range
• Destination IP Address of Arriving Packet
10.7.3.47
• Apply the Mask
255.255.255.0
• Result of Masking
10.7.3.0
• Destination Value
10.7.3.0
• Does Destination Value Match the Masking Result?
Yes
• Conclusion
Row 1 is a
match.
8-30
Figure 8-8: Detailed Row-Matching Algorithm
Box
Row
Destination
Mask
…
…
…
1
10.7.3.0
255.255.255.0
…
…
…
• Example 2: A Destination IP Address that is NOT in the Range
• Destination IP Address of Arriving Packet
10.7.5.47
• Apply the Mask
255.255.255.0
• Result of Masking
10.7.5.0
• Destination Value
10.7.3.0
• Does Destination Value Match the Masking Result?
No
• Conclusion
Row 1 is NOT
a match.
8-31
Figure 8-9: Interface and Next-Hop Router
Box
• Switches
– A switch port connects directly to a single computer or
another switch
– Sending the frame out a port automatically gets it to the
correct destination
Frame
8-32
Figure 8-9: Interface and Next-Hop Router
Box
• Routers
– Router ports (interfaces) connect to subnets, which have
multiple hosts and that may have multiple routers
– The packet must be forwarded to a specific host or router
on that subnet
Host
IP
Packet
Subnet
on Router
Interface
Next-Hop
Router
Host
Next-Hop
Router
8-33
Figure 8-9: Interface and Next-Hop Router
Figure 8-9:
Interface and Next-Hop Router
Next-Hop
Router
Interface (port)
Router
Forwarding
Packet
Router A
Box
Next-Hop Router
Packet to Router B out Interface 5
IP Subnet on
Interface (Port) 5
Possible
Next-Hop
Router
Router B
Router C
Packet must be sent to
a particular host or
router
Possible
Destination
Host
Possible
Next-Hop
Router
Best-match row has both an interface (indicating a subnet)
and also a next-hop router value to indicate a host or router on the subnet.
(Not just a Next Hop Router Column)
8-34
Dynamic Routing
Protocols
Dynamic Routing Protocol
Routing Table Information
Figure 8-10: Dynamic Routing
Protocols
• Routing
– How do routers get their routing table information?
– Routers constantly exchange routing table information
with one another using dynamic routing protocols
– Note that the term routing is used in two ways In
TCP/IP
• For IP packet forwarding and
• For the exchange of routing table information
through routing protocols
Dynamic Routing Protocol
Routing Table Information
8-36
Figure 8-10: Dynamic Routing
Protocols
• Autonomous System
– An organization’s internal network (internet)
• Exterior Dynamic Routing Protocols
– Between Autonomous Systems, companies use an
exterior dynamic routing protocol
– The dominant exterior dynamic routing protocol is the
Border Gateway Protocol (BGP)
• Gateway is an obsolete name for router
– Company is not free to choose whatever exterior
routing protocol it wishes
8-37
Figure 8-10: Dynamic Routing
Protocols
• Interior Dynamic Routing Protocols
– Within an Autonomous System, firms use interior
dynamic routing protocols
– Can select their own interior dynamic routing protocol
– Routing Information Protocol (RIP) for small internets
– Open Shortest Path First (OSPF) for larger internets
– Enhanced Interior Gateway Routing Protocol (EIGRP)
• Non-TCP/IP proprietary CISCO protocol
• Can handle multiple protocols, not just TCP/IP
8-38
Figure 8-11: Dynamic Routing Protocols
Figure 8-11: Dynamic Routing Protocols
Internal
Router
RIP,
OSPF, or
Internal
EIGRP
Router
RIP, OSPF, and EIGRP
Interior Dynamic Routing Protocols
Border
Router
Autonomous System
Recap
RIP,
OSPF, or
EIGRP
BGP Is an Exterior Dynamic
Routing Protocol
Autonomous System
Border
Router
8-39
The Address
Resolution Protocol
(ARP)
Figure 8-12: Address Resolution Protocol (ARP)
Figure 8-12: Address Resolution Protocol (ARP)
Packet
ARP Cache:
Known
IP addressEthernet
Address
Pairs
Frame
Originating
Router
1.
Broadcast ARP Request Message:
Host
"IPThe
HostSituation:
110.19.8.17,
110.19.8.47
whatwishes
is your 48-bit
MAC
address?"
The router
to pass
the
packet to
the
does not respond to
destination
host or to a next-hop router.
Router
B
ARP Request.
The router
knows the destination IP address of the target.
110.19.8.
notmust
reply learn the target’s MAC layer address
Thedoes
router
in order to be able to send the packet to the target in a frame.
Host
The router uses the Address Resolution Protocol
(ARP)
110.19.8.17
2.
ARP Response Message:
"My MAC address is A7-23-DA-95-7C-99".
replies.
8-41
Figure 8-12: Address Resolution Protocol (ARP)
Figure 8-12: Address Resolution Protocol (ARP)
ARP Cache:
Known
IP addressEthernet
Address
Pairs
1: Router broadcasts ARP Request to all
hosts and routers on the subnet.
Originating
Router
1.
Broadcast ARP Request Message:
"IP Host 110.19.8.17,
what is your 48-bit MAC address?"
Router B
110.19.8.
does not reply
2.
ARP Response Message:
"My MAC address is A7-23-DA-95-7C-99".
Host
110.19.8.47
does not respond to
ARP Request.
Host
110.19.8.17
replies.
8-42
Figure 8-12: Address Resolution Protocol (ARP)
Figure 8-12: Address Resolution Protocol (ARP)
ARP Cache:
Known
IP addressEthernet
Address
Pairs
2: ARP Reply sent by the host with the
target IP address.
Other hosts ignore it.
Originating
Router
1.
Broadcast ARP Request Message:
"IP Host 110.19.8.17,
what is your 48-bit MAC address?"
Router B
110.19.8.
does not reply
2.
ARP Response Message:
"My MAC address is A7-23-DA-95-7C-99".
Host
110.19.8.47
does not respond to
ARP Request.
Host
110.19.8.17
replies.
This is the
Destination host
8-43
Figure 8-12: Address Resolution Protocol (ARP)
Figure 8-12: Address Resolution Protocol (ARP)
ARP Cache:
Known
IP addressEthernet
Address
Pairs
3.
Router puts the MAC address in its ARP cache;
uses it for subsequent packets to the host
Originating
Router
1.
Broadcast ARP Request Message:
"IP Host 110.19.8.17,
what is your 48-bit MAC address?"
Router B
110.19.8.
does not reply
2.
ARP Response Message:
"My MAC address is A7-23-DA-95-7C-99".
Host
110.19.8.47
does not respond to
ARP Request.
Host
110.19.8.17
replies.
8-44
Multiprotocol Label
Switching (MPLS)
Figure 8-13: Multiprotocol Label
Switching (MPLS)
• Routers are Connected in a Mesh
– Multiple alternative routes make the routing decision for
each packet very expensive
• PSDNs (Chapter 7) also are Arranged in a Mesh
– However, a best path (virtual circuit) is set up before
transmission begins
– Once a VC is in place, subsequent frames are handled
quickly and inexpensively
• MPLS Does Something Like this for Routers
8-46
Figure 8-13: Multiprotocol Label
Switching (MPLS)
• MPLS Adds a Label Before Each Packet
– Label sits between the frame header and the IP
header
– Contains an MPLS label number
– Like a virtual circuit number in a PSDN frame
– Label-switching router merely looks up the MPLS
label number in its MPLS table and sends the packet
back out
IP
Packet
MPLS
Label
Data Link
Header
8-47
Figure 8-13: Multiprotocol Label
Switching (MPLS)
• Advantages of MPLS
Label
Port
1
3
8
2
– Router does a simple table lookup. This is fast and
therefore inexpensive per packet handled
• As fast as Ethernet switching!
– Can use multiple label numbers to give traffic between
two sites multiple levels of priority or quality of service
guarantees
– MPLS supports traffic engineering: balancing traffic on
an internet
8-48
Figure 8-13:
Multiprotocol Label Switching (MPLS)
Figure 8-13: Multiprotocol Label Sw itching (MPLS)
Label-Switching
Router 1
Label-Switching
First router Router 2
adds the label
Legend
Packet Label
Label-Switching Table
Label Interface
A
1
C
1
F
3
LabelSwitching
Router 3
Label-Switching
Last router
Router 4
drops the label
Label-Switching
Router 5
Label-Switched
Path
MPLS reduces forwarding costs and permits traffic engineering,
including quality of service and traffic load balancing
8-49
The Domain Name
System (DNS)
Figure 8-14: Domain Name System (DNS)
Hierarchy
Figure 8-14: Domain Name System (DNS) Hierarchy
(root)
Top-Level
Domain
Names
.edu
.org
.net
A domain is a group of resources
.au of.ie
.nl
.com
.uk
under
the control
an organization.
Second-Level
The domain name system is a
Domain
general system
hawaii.edu Names microsoft.com
cnn.comfor managing names.
It is a hierarchical naming system.
cba.hawaii.edu
voyager.cba.hawaii.edu
Subnet Name
Queries to a DNS server can get
Information about a domain.
Host Names ntl.cba.hawaii.edu
8-51
Figure 8-14: Domain Name System (DNS)
Hierarchy
Figure 8-14: Domain Name System (DNS) Hierarchy
(root)
Top-Level
Domain
Names
.edu
.org
.net
.com
.au
.ie
.nl
.uk
Second-Level
The highest level (0) is called the root.
Domain
hawaii.edu Names microsoft.com
cnn.com
There are 13
DNS Root Servers.
They point to lower-level servers.
cba.hawaii.edu
voyager.cba.hawaii.edu
Subnet Name
Host Names ntl.cba.hawaii.edu
8-52
Figure 8-14: Domain Name System (DNS)
Hierarchy
Figure 8-14: Domain Name System (DNS) Hierarchy
(root)
Top-Level
Domain
Names
.edu
.org
.net
.com
Second-Level
Domain
hawaii.edu Names microsoft.com
cba.hawaii.edu
voyager.cba.hawaii.edu
.au
.ie
.nl
.uk
cnn.com
Top-level domains are
generic TLDs (.com, .net., .org, etc.) or
country TLDs (.ca, .uk, .ie, etc.)
Subnet Name
Host Names ntl.cba.hawaii.edu
8-53
Figure 8-14: Domain Name System (DNS)
Hierarchy
Figure 8-14: Domain Name System (DNS) Hierarchy
(root)
Top-Level
Domain
Names
.edu
.org
.net
.com
Second-Level
Domain
hawaii.edu Names microsoft.com
cba.hawaii.edu
voyager.cba.hawaii.edu
Subnet Name
.au
Organizations seek
good secondlevel domain
names
.nl
.ie
.uk
cnn.com
microsoft.com
hawaii.edu
etc.
cnn.com
Firms get them from
address registrars
Host Names ntl.cba.hawaii.edu
8-54
Figure 8-14: Domain Name System (DNS)
Hierarchy
Figure 8-14: Domain Name System (DNS) Hierarchy
(root)
Top-Level
Domain
Names
.edu
.org
.net
.com
.au
.ie
.nl
.uk
Second-Level
Host names are the bottom
Domain
the DNS hierarchy.
hawaii.edu Names microsoft.com ofcnn.com
cba.hawaii.edu
voyager.cba.hawaii.edu
A DNS request for a host name
will return its IP address.
Subnet Name
Host Names ntl.cba.hawaii.edu
8-55
The Internet Control
Message Protocol
(ICMP)
Figure 8-15: Internet Control Message Protocol
(ICMP) for Supervisory Messages
Figure 8-15: Internet Control Message Protocol (ICMP) for Supervisory Messages
ICMP is the supervisory protocol
Host Unreachable
at the internet
layer.
Router
Error Message
Echo
Response
Echo Request
(Ping)
ICMP
IP
Message Header
ICMP messages are encapsulated in the
data fields of IP packets.
There are no transport or
Application layer headers or messages
8-57
Figure 8-15: Internet Control Message Protocol
(ICMP) for Supervisory Messages
Figure 8-15: Internet Control Message Protocol (ICMP) for Supervisory Messages
Host Unreachable
Error Message
Router
Echo Request
ICMP
IP
When an error occurs,
the
device
Message Header
(Ping)
noting the error
may try to respond with an
Echo
ICMP error Response
message describing the problem.
ICMP error messages often are not sent
for security reasons because
attackers can use them to learn about a network
8-58
Figure 8-15: Internet Control Message Protocol
(ICMP) for Supervisory Messages
Figure 8-15: Internet Control Message Protocol (ICMP) for Supervisory Messages
To see if another host is active, a host
can send the target host an ICMP echo
message (called a ping).
Host Unreachable
Router
If the
host
is active, it will send back an
Error
Message
echo response message confirming that it is active.
Echo
Response
Echo Request
(Ping)
ICMP
IP
Message Header
8-59
Dynamic Host
Configuration Protocol
(DHCP)
From Chapter 1
Figure 8-16: Dynamic Host
Configuration Protocol (DHCP)
• DHCP Gives Each Client PC at Boot-Up:
– A temporary IP Address (we saw this in Chapter 1)
– A subnet mask
– The IP addresses of local DNS servers
• Better Than Manual Configuration
– If subnet mask or DNS IP addresses change, only the
DHCP server has to be updated manually
– Client PCs are automatically updated when they next
boot up
8-61
The Internet
Protocol (IP)
Versions 4 and 6
Figure 8-17: IPv4 and IPv6 Packets
Bit 0
IP Version 4 Packet
Bit 31
Version Header
Diff-Serv
Total Length
(4 bits) Length
(8 bits)
(16 bits)
Value (4 bits)
Length in octets
is 4
(0100)
Identification (16 bits)
Flags Fragment Offset (13 bits)
Unique value in each original
(3 bits)
Octets from start of
IPv4
is
the
dominant
version
of
IP
today.IP fragment’s
IP packet
original
The version number in its header is 4 (0100).
data field
Timeheader
to Livelength
Protocol
(8 bits)
Header
Checksum
The
and total
length field tell
the size
of the packet.
(8 bits)
1=ICMP, 6=TCP,
(16 bits)
The Diff-Serv field17=UDP
can be used for quality of service labeling.
(But MPLS is being used instead by most carriers)
8-63
Figure 8-17: IPv4 and IPv6 Packets
Bit 0
IP is
Version
4 Packet
The second row
used for
reassembling fragmented Bit 31
IP packets,
but fragmentation isTotal
quiteLength
rare,
Version Header
Diff-Serv
so (8
webits)
will not look at these fields.
(4 bits) Length
(16 bits)
Value (4 bits)
Length in octets
is 4
(0100)
Identification (16 bits)
Flags Fragment Offset (13 bits)
Unique value in each original
(3 bits)
Octets from start of
IP packet
original IP fragment’s
data field
Time to Live
Protocol (8 bits)
Header Checksum
(8 bits)
1=ICMP, 6=TCP,
(16 bits)
17=UDP
8-64
Figure 8-17: IPv4 and IPv6 Packets
The sender sets the time-to-live value (usually 64 to 128).
Each router along the way decreases the value by one.
A router decreasing the value to zero discards the packet.
Bit 0
IP Version 4 Packet
Bit 31
It may send an ICMP error message.
Version Header
Diff-Serv
Total Length
(4 bits)The
Length
(8 bits)
bits)
protocol field
describes the message(16
in the
data field
Value (4 bits)
Length
(1=ICMP, 2=TCP, 3=UDP,
etc.) in octets
is 4
(0100)The header checksum is used to find errors in the header.
Identification
If a packet
(16 bits)
has an error,
Flags
the router
Fragment
dropsOffset
it.
(13 bits)
Unique value
There
in is
each
no retransmission
original
(3 bits)
at the internet
Octets layer,
from start of
IP packet
so the internet layer is still unreliable.
original IP fragment’s
data field
Time to Live
Protocol (8 bits)
Header Checksum
(8 bits)
1=ICMP, 6=TCP,
(16 bits)
17=UDP
8-65
Figure 8-17: IPv4 and IPv6 Packets
Bit 0
IP Version 4 Packet
Bit 31
Source IP Address (32 bits)
Destination IP Address (32 bits)
Options (if any)
Padding
The source andData
destination
Field IP addresses
Are 32 bits long, as you would expect.
Options can be added, but these are rare.
8-66
Figure 8-17: IPv4 and IPv6 Packets
Bit 0
Version
(4 bits)
Value
is 6
(0110)
IP Version 6 is the emerging
Internet protocol.
IP version
Versionof6 the
Packet
Bit 31
Diff-Serv
Flow Label (20 bits)
Has 128
bit addresses
(8 bits)
Marks
a packet
as part offor
a specific flow
an almost unlimited number of IP addresses.
Needed because of rapid growth in Asia.
Payload Length
Next Header
Hop Limit
Also needed because
of the exploding
(16 bits)
Name
number(8
ofbits)
mobile
devices (8 bits)
of next header
Source IP Address (128 bits)
Destination IP Address (128 bits)
Next Header or Payload (Data Field)
8-67
The Transmission
Control Protocol
(TCP)
Figure 8-18: TCP Segment and UDP Datagram
Bit 0
TCP Segment
Source Port Number (16 bits)
Bit 31
Destination Port Number (16 bits)
Sequence Number (32 bits)
Acknowledgment Number (32 bits)
Header
Length
(4 bits)
Reserved
The source
Flagand
Fields
destination portWindow
numbers
Size
(6 bits)
specify a(6
particular
bits)
application on
(16the
bits)
source and destination multitasking computers
(Discussed later)
TCP Checksum (16 bits)
Urgent Pointer (16 bits)
Sequence numbers are 32 bits long.
Flag fields are one-bit fields. They include SYN, ACK, FIN,
So are acknowledgment numbers.
and RST.
8-69
Figure 8-18: TCP Segment and UDP Datagram
Flags are one-bit fields.
Bit 0
TCPvalue
Segment
Bit 31
If a flag’s
is 1, it is “set”.
If a flag’s
value isDestination
0, it is “not Port
set.”Number (16 bits)
Source Port Number
(16 bits)
TCP has six flags
Sequence Number (32 bits)
If the TCP Checksum field’s value is correct,
The receiving process sends back an acknowledgment.
Acknowledgment Number (32 bits)
Header
Length
(4 bits)
Reserved Flag Fields
(6 bits)
(6 bits)
TCP Checksum (16 bits)
Window Size
(16 bits)
Urgent Pointer (16 bits)
8-70
Figure 8-18: TCP Segment and UDP Datagram
For flow control (to
tell Segment
the other party to slow down),
TCP
Bit 31
The sender places a small value in the Window Size field.
Source Port Number (16 bits)
Destination Port Number (16 bits)
If the Window Size is small, the receiver will have to stop transmitting
Sequence
Number
(32 a
bits)
after a few more segments
(unless
it gets
new acknowledgment
extending the number of segments it may send.)
Acknowledgment Number (32 bits)
Bit 0
Header
Length
(4 bits)
Reserved Flag Fields
(6 bits)
(6 bits)
TCP Checksum (16 bits)
Window Size
(16 bits)
Urgent Pointer (16 bits)
8-71
Figure 8-18: TCP Segment and UDP Datagram
Bit 0
TCP Segment
Options (if any)
Bit 31
Padding
Data Field
TCP segment headers can end with options.
Unlike IPv4 options,
TCP options are very common.
If an option does not end at a 32-bit boundary,
padding must be added.
8-72
The User Datagram
Protocol (UDP)
Figure 8-18: TCP Segment and UDP Datagram
Bit 0
UDP Datagram
Bit 31
Source Port Number (16 bits)
Destination Port Number (16 bits)
UDP Length (16 bits)
UDP Checksum (16 bits)
Data Field
UDP messages (datagrams) are very simple.
Like TCP, UDP has 16-bit port numbers.
The UDP length field allows variable-length application messages.
If the UDP checksum is correct, there is no acknowledgment.
If the UDP checksum is incorrect, the UDP datagram is dropped.
8-74
Figure 8-19: TCP Connection Openings and
Closings
• TCP is a connection-oriented protocol
– Each connection has a formal opening process
– Each connection has a formal closing process
– During a connection, each TCP segment is
acknowledged
• (Of course, pure acknowledgments are not
acknowledged)
8-75
Figure 8-19: TCP Connection Openings and
Closings
Normal Three-Way Opening
SYN
SYN/ACK
ACK
A SYN segment is a segment in which the SYN bit is set.
One side sends a SYN segment requesting an opening.
The other side sends a SYN/acknowledgment segment.
Originating side acknowledges the SYN/ACK.
8-76
Figure 8-19: TCP Connection Openings and
Closings
Normal Four-Way Close
FIN
ACK
FIN
ACK
A FIN segment is a segment in which the FIN bit is set.
Like both sides saying “good bye” to end a conversation.
8-77
Figure 8-19: TCP Connection Openings and
Closings
Abrupt Reset
RST
An RST segment is a segment in which the RST bit is set.
A single RST segment breaks a connection.
Like hanging up during a phone call.
There is no acknowledgment.
8-78
Port Numbers and
Sockets in TCP and
UDP
TCP and UDP Port Numbers
• Computers are multitasking devices
– They run multiple applications at the same time
– On a server, a port number designates a specific
applications
HTTP Webserver
Application
SMTP E-Mail
Applications
Port 80
Port 25
Server
8-80
TCP and UDP Port Numbers
• Major Applications Have Well-Known Port Numbers
– 0 to 1023 for both TCP and UDP
– HTTP is TCP Port 80
– SMTP is TCP Port 25
HTTP Webserver
Application
SMTP E-Mail
Applications
Port 80
Port 25
Server
8-81
TCP and UDP Port Numbers
• Clients Use Ephemeral Port Numbers
– 1024 to 4999 for Windows Client PCs
– A client has a separate port number for each connection
to a program on a server
E-Mail
Application
on Mail
Server
Webserver
Application
on Webserver
Port 4400
Port 3270
Client
8-82
Figure 8-20: Use of TCP (and UDP) Port Numbers
A socket is an
IP address, a colon, and a port number.
Client 60.171.18.22
1.33.17.3:80
123.30.17.120:25
128.171.17.13:2849
It represents a specific application (Port number)
on a specific server (IP address)
Or a specific connection on a client.
Client PC
128.171.17.13
Port 2849
Webserver
1.33.17.13
Port 80
SMTP Server
123.30.17.120
Port 25
8-83
Figure 8-20: Use of TCP (and UDP) Port Numbers
Client
60.171.18.22
Source: 60.171.18.22:2707
Destination: 1.33.17.13:80
This shows sockets for a client
packet sent to a webserver application
on a webserver
Webserver
1.33.17.13
Port 80
SMTP Server
123.30.17.120
Port 25
8-84
Figure 8-20: Use of TCP (and UDP) Port Numbers
Client
60.171.18.22
Source: 60.171.18.22:2707
Destination: 1.33.17.13:80
Source: 1.33.17.13:80
Destination: 60.171.18.22:2707
Sockets in
two-way
transmission
Webserver
1.33.17.13
Port 80
SMTP Server
123.30.17.120
Port 25
8-85
Figure 8-20: Use of TCP (and UDP) Port Numbers
Client
60.171.18.22
Source: 60.171.18.22:2707
Destination: 1.33.17.13:80
Source: 1.33.17.13:80
Destination: 60.171.18.22:2707
Source: 60.171.18.22:4400
Destination: 123.30.17.120:25
Clients use a different ephemeral
port number for different connections
Webserver
1.33.17.13
Port 80
SMTP Server
123.30.17.120
Port 25
8-86
Layer 3 Switches
Figure 8-21: Layer 3 Switches and Routers
in Site Networks
Figure 8-21: Layer 3 Sw itches and Routers in Site Internets
L3
To
Other
Sites
Layer 3
Switch
L3
Router
Layer 3 switches are
faster and cheaper to
buy than traditional
routers.
However, they are
usually limited in
functionality.
Layer 3
Switch
Ethernet Workgroup
Switch
Layer 3 switches are
routers.
Ethernet Workgroup
Switch
They also are
expensive to manage.
They are typically
used between
Usually too expensive to replace workgroup switches.
Usually too limited in functionality to replace border routers.
Replaces core switches in the middle.
8-88
Related documents