Computer networks routing fundamentals and subnets
Trang 1
Routing Fundamentals and Subnets
Trang 22008/7/19
Routing overview Routing versus switching Routed versus routing Path determination Routing tables
Routing algorithms and
metrics
IGP and EGP Link state and distance vector
Routing protocols
10.3 The Mechanics of Subnetting
Classes of network IP addresses
Introduction to and reason for
subnetting Establishing the subnet mask address
Applying the subnet mask Subnetting Class A and B networks
Calculating the resident subnetwork through ANDing
Trang 310.1 Routed Protocol
2008/7/19
Trang 4Routable and routed protocols
IP / IPX NetBEUI 2?
2008/7/19
Trang 6
192.168.10.250 192.168.10.251 192.168.10.252 192.168.10.253
2008/7/19
Trang 7IP as a routed protocol
Hierarchical network-addressing scheme
IP is a connectionless, unreliable, best-effort delivery
protocol
The term connectionless means that no dedicated
circuit connection is established prior to transmission
as there is when placing a telephone call
The terms unreliable and best-effort do not imply that the system is unreliable and does not work well, but that IP does not verity that the data reached its
destination This function is handled by the upper layer protocols
IP determines the most efficient route for data based
on the routing protocol
2008/7/19
Trang 8IP as a routed protocol (conI.)
Trang 9Packet propagation and switching within a
Frame | Network ,_, | Frame
Ỷ Physical Header | Header “ Trailer
The transport layer again segments, sequences and adds error checking to the email message The network layer source and destination addresses are added to the datagram The ARP cache provides the MAC address for the destination IP address,
so the Ethernet frame is added with the source and destination addresses
2008/7/19
Trang 10Packet propagation and switching within a router (cont.)
Destination Source Source Destination
DD:EC:BC:AB:04:AC | FE:ED:F9:44:45:66 ' 198 150 11 34! 198 150.11 163' Email CRC-32
Trang 11Packet propagation and switching within a router (cont.)
Client (Bill Smith) Toolbar: Maximize 198.150.11.34 198.150.11.163
The router picks up the frame which was addressed to its MAC address and
strips off the Ethernet frame
Trang 12Packet propagation and switching within a router (cont.)
498.1504145 — DD:EC:BC:AB:04:AC DD:EC:BC:43:7B:34 198.150.11.165
198.150 11.163 IP Address 255.255.255.224 Subnet mask 198.150 11.160 Result
The router applies the subnet mask to the destination address
The router then compares the result to its router table The table shows that to get to network 198.150.11.160 the packet must be forwarded out the serial (198.150.11.65) port on the router
2008/7/19 12
Trang 13Packet propagation and switching within a router (cont.)
Client (Bill Smith) Toolbar: Maximize
198.150.11.34 198.150.11.163 FE:ED:F9:44:45:66 FE:ED:F9:EF:ED:EC
198.150.1165 198.150.11.66
.150.11.33 198.150.11.161 198.150.11.45 DD:EC:BC:AB:04:AC DD:EC:BC:43:7B:34 198.150.11.165
PPP PPP 198.150.11.34) 198.150.11.163 | Email | CRC-32
Network
Header
Data Link PPP | Network Ppp
Physical Header| Header Trailer
The request is encapsulated for serial transmission and sent to the next router
Trang 14Packet propagation and switching within a router (cont.)
Client (Bill Smith) Toolbar: Maximize 198.150.11.34 198.150.11.163 FE:ED:F9:44:45:66 FE:ED:F9:EF:ED:EC
198.150.11.65 198.150.1
198.150.11.33 198.150.11.161
198.150.11.45 DD:EC:BC:AB:04:AC DD:EC:BC:43:7B:34 198.150.11.165 FE:ED:F9:FE:44:AF FE:ED:F9:89:54:23
Trang 15
Packet propagation and switching within a router (cont.)
Client (Bill Smith)
The router applies the subnet mask to the destination address The router then compares the result to its router table The table shows that to get to network 198.150.11.160 the packet must be forwarded out the Ethernet
(198.150.11.161) port on the router
2008/7/19 15
Trang 16Packet propagation and switching within a router (cont.)
198.1 198.150.11.45 DD:EC:BC:AB:04:AC DD:EC:BC:43:7B:34 198.150.11.165
Frame Header Network Header Data Frame
Trailer
FE:ED:F9:EF:ED:EC ' DD:EC:BC:43:7B:34 198.150.11 34 198 150 11 163 ': Email ': CRC-32
2008/7/19 16
Trang 17Packet propagation and switching within a router (cont.)
The recieving computer de-encapsulates the data packet and processes the data
This involves the transport layer reassembling the data packets in the proper order
and checking for errors
2008/7/19 17
Trang 18Packet propagation and switching within a router (cont.)
header and trailer a address with routing table the new CRC
destination IP data packet in
address from the appropnate
frame header
Ỷ
Forward the new frame
Trang 19
Internet Protocol (IP)
2 types of delivery services are connectionless and connection-oriented
They provide the actual end-to-end delivery of data in an inter-network Most network services use a connectionless delivery system
Connectionless service (packet switched)
Packets may take different paths to get through the network (possibly
arrive out of order), but are reassembled after arriving at the
estination
The destination is not contacted before a packet is sent
Connection-oriented (circuit switched)
A connection is established between the sender and the recipient before any data is transferred
All packets travel sequentially across the same physical or virtual circuit
2008/7/19 19
Trang 20Anatomy of an IP packet
The header fields are the information that is provided to the upper layer protocols defining the data in the packet
Version — The version of IP currently used; different version > reject the packets
IP header length (HLEN) — The datagram header length in 32-bit words
Type-of-service (TOS) — The level of importance that has been assigned by a particular upper-layer protocol
Total length — The length of the entire packet in bytes, including data and header
To get the length of the data payload subtract the HLEN from the total length
Identification — Integer, the sequence number
Flags — information of fragmentation One bit specifies whether the packet can be fragmented, and the other 2-bit specifies whether the packet is the last fragment in
a series of fragmented packets
Source IP Address Destination IP Address
_IP Options (if any) | Padding
These are the header fields in an IP packet header All field lengths
are fixed except for IP options and the padding fields
Trang 21Anatomy of an IP packet (cont.)
Fragment offset — Used to help piece together datagram fragments, 13 bits This field allows
the previous field to end on a 16-bit boundary
Time-to-live (TTL) — A field that specifies the number of hops a packet may travel This number
is decreased by one as the packet travels through a router When the counter reaches zero the packet is discarded This prevents packets from looping endlessly
Protocol — indicates which upper-layer protocol, such as TCP or UDP
Header checksum — helps ensure IP header integrity
Source address — specifies the sending node IP address
Destination address — specifies the receiving node IP address
Options — allows IP to support various options, such as security, variable length
Fadaing — extra zeros are added to this field to ensure that the IP header is always a multiple of its
Data — contains upper-layer information, variable length up to 64 Kb
Time to Live Protocol Header Checksum
These are the header fields in an IP packet header All field lengths
are fixed except for IP options and the padding fields
Trang 2210.2 IP Routing Protocols
Trang 23Routing overview
Routing is an OS]! Layer 3 function
Routing is the process of finding the most efficient path from one device
to another
The primary device that performs the routing process is the router
The following are the two key functions of a router:
Routers must maintain routing tables and make sure other routers
know of changes in the network topology This function is performed using a routing protocol to communicate network information with other
routers
When packets arrive at an interface, the router must use the routing table to determine where to send them The router switches the packets to the appropriate interface, adds the necessary framing
Information for the interface, and then transmits the frame
The encapsulation and de-encapsulation process occurs each time a packet transfers through a router
2008/7/19 23
Trang 24Routing overview (cont )
Delay Reliability Load Cost
The network layer is responsible for routing packets through a network
Trang 25
Routing versus switching
The primary difference
Switching occurs at Layer 2, the data link layer
Routing occurs at Layer 3, network layer
Routing and switching use different information in the process of moving data from source to destination
Telephone systems, local and long distance calls
i
Layer 2 switching based addres IN Layer 2 switching Se
sai ain based on MAC address
Trang 26Routing versus switching (cont )
Routing Table Leamed Network Address Hop Interface
Trang 27Routing versus switching (cont )
as the actual addresses are too long to fit in the graphic)
The routing tables also track how the route was learned (in this case either directly connected [C] or learned by RIP [R]), the network IP address for reachable networks, the hop count or distance to those networks, and the interface the data must be sent out to get to the destination network
2008/7/19 27
Trang 28Routing versus switching (cont )
Switched networks do not block broadcasts
Routers block broadcasts, routers also provide a higher level of security and bandwidth control than
Security Higher Lower
2008/7/19 28
Trang 29Houted versus routing
Protocols used at the network layer that transfer data from one
host to another across a router ES
are called routed or routable
rotocols Routed protocols ol `
transport data across a network RIP | "-
Routing protocols allow routers to = ———+—
choose the best path for data 'DECNeI [7 from source to destination _AppleTalk | vy |
Routers use routing protocols to IBaumUNS | Ý |
share routing information In other words, routing protocols enable routers to route routed protocols
2008/7/19 29
Trang 30Routed versus routing (conI.)
A routed protocol functions include the following:
Includes any network protocol suite that provides enough information in its network layer address to allow a router to forward it to the next device and ultimately to its destination
Defines the format and use of the fields within a packet
A routing protocol functions includes the following:
Provides processes for sharing route information
Allows routers to communicate with other routers to
update and maintain the routing tables
2008/7/19 30
Trang 31Routed versus routing (conI.)
Trang 32Routed versus routing (conI.)
Network Destination Exit
Protocol Network Interface
Connected |10.120.2.0 E0 RIP 172.16.2.0 S0
routers to determine paths
and maintaining routing tables
After the path is determined
a router can route a routed protocol
32
Trang 33Path determination
Path determination enables a router to compare the destination address to the available routes in its
routing table, and to select the best path
The routers learn of these available routes through
static routing or dynamic routing
Routes configured manually by the network administrator are static routes
Routes learned by others routers using a routing protocol are dynamic routes
Routers can make decisions based on the load,
bandwidth, delay, cost, and reliability of a network
link
Each router that the packet encounters along the way
is called a hop
2008/7/19 33
Trang 34Path determination (cont.)
———
: Apply ae af Forward the date
Receive frame Remove routing table entry ——œ đc ih ee
on interface frame header on destination IP routing table entry
4 Compare masked Ecapsulale the
Y An Sư = destination IP data packet in the
Pi mation address with entry appropriate frame
a“ “Yes | address from network address
& SE uter? | ¥
Get first A ich? frame
rauting table _ od y entry = “No |
¥ Ayes] =<
Discard data | „fe there | Na | “1s thera | End | —
Trang 35Routing tables
Routers use routing protocols to build and maintain routing tables that contain route information
This information varies depending on the routing protocol used
Routers keep track of important information in their routing tables, including the following:
2008/7/19
Protocol type — The type of routing protocol that created the routing table entry Destination/next-hop associations — These associations tell a router that a particular destination is either directly connected to the router, or that it can be reached using another router called the “next-hop” on the way to the final
destination
When a router receives an incoming packet, it checks the destination address and attempts to match this address with a routing table entry
Routing metric — Different routing protocols use different routing metrics
Routing metrics are used to determine the desirability of a route
Routing Information Protocol (RIP) uses hop count as its only routing metric
Interior Gateway Routing Protocol (IGRP) uses a combination of bandwidth, load, delay, and reliability metrics to create a composite metric value
Outbound interfaces — The interface that the data must be sent out on, in order
to reach the final destination
35