Lehrstuhl für Netzarchitekturen und Netzdienste
Institut für Informatik Technische Universität München
ilab Lab 1+2 The Basics / Static Routing ISO/OSI Layer Model - - PowerPoint PPT Presentation
Lehrstuhl fr Netzarchitekturen und Netzdienste Institut fr Informatik Technische Universitt Mnchen ilab Lab 1+2 The Basics / Static Routing ISO/OSI Layer Model (1979-1983) Applications, e.g. HTTP, FTP, 7 Application Layer
Lehrstuhl für Netzarchitekturen und Netzdienste
Institut für Informatik Technische Universität München
Ilab: The basics / Static Routing 2
Application Layer Presentation Layer Session Layer Transport Layer
Network Layer Data Link Layer Physical Layer
Applications, e.g. HTTP, FTP, … Management of Sessions Representation of data Transport, e.g. TCP, UDP, SCTP Routing, e.g. IP Transmission of frames Physical layer, e.g. Ethernet
Ilab: The basics / Static Routing 3
Application Layer Transport Layer Internet Layer Link Layer Interface to the physical medium
Ethernet, WLAN, Token Ring, FDDI, …
Routing in the internet
IPv4, IPv6
End-to-end data transport
tcp, udp, sctp, …
Applications
http, ftp, telnet, smtp, pop, …
3 1 2 4 6 x 5 = Equivalent to ISO/OSI 7
Ilab: The basics / Static Routing 4
Router Router
Telephone, modem SDH / SONET (Hi-Speed Fibre) WLAN
Application TCP IP Net 1 IP Net 1 Net 2 IP Net 2 Net 3 Application TCP IP Net 3
instances of the same protocol layer over an abstract medium
instance
Ilab: The basics / Static Routing 5
Router Router
Telefone, Modem SDH / SONET (Hi-Speed Fiber) WLAN
Application TCP IP Net 1 IP Net 1 IP Application TCP IP Net 2 Net 2 Net 3 Net 3
communicate with instances of protocol layers above or below.
Ilab: The basics / Static Routing 6
A service provides a Service Access Point (SAP) to the layer above it Protocol Data Units (PDUs) are encapsulated TCP/UDP adds process addressing (ports) to IP
IP routes data packets through the network to the destination
MAC/LLC-Header IP-Header TCP/UDP-Header IP-Header TCP/UDP-Header UDP-Header Data Application Transport Layer Link Layer Internet Layer TCP-Header
bzw.
Data Data Data Data Trailer
Ilab: The basics / Static Routing 7
Hold no information (state) in nodes between sender of data and
destination (e.g. no need for resynchronisation)
All information specific for the stream is stored only at the sender and
the destination of data: End-to-end principle
Separation of packet forwarding from one hop to the next and the
creation of routing tables
Ilab: The basics / Static Routing 8
are assigned to the network layer (ISO/OSI)
ICMP RARP ARP TCP UDP IP
Session Layer
Transport Layer Network Layer Data Link Layer
IGMP
Ilab: The basics / Static Routing 9
Paket-switched Connectionless datagram service Unreliable transmission:
normally cannot be fixed by IP, too
ICMP (Internet Control Message Protocol) is used for error notification No flow control Used in private and public networks
Best effort, no quality of service (QoS) guaranteed
Ilab: The basics / Static Routing 10
Version Hdr.Len DiffServ Total Length Identifier Flags Fragment Offset Protocol Time to Live Header Checksum Source Address Destination Address Options and Padding Data 3 7 15 31 IP-Header
0 DF MF
Reserved Don‘t Fragment More Fragments Bit
DiffServ Codepoint ECN
Congestion Control (Explicit Congestion Notification) QoS Class
Ilab: The basics / Static Routing 11
IP only provides (unreliable) paket transmission When errors occur or for testing purposes ICMP (Internet Control
Message Protocol) is used.
ICMP uses IP Message type, examples:
holds the time of arrival (query) and time of sending (response) is added. Router connection interrupted Router Router ICMP message Sender Destination Router
Ilab: The basics / Static Routing 12
Destination unreachable:
A data packet could not be delivered, e.g. because of an interrupted cable or a router failure.
Time to live exceeded:
A data packet was dropped by a router because the packet‘s TTL exceeded.
Parameter problem:
A data packet was discarded due to illegal values in its IP header.
Source quench:
A overloaded communication system requests the sender to throttle transmission rate.
Redirect:
A data packet should be sent over another router.
Ilab: The basics / Static Routing 13
Type Code Checksum
Transmission of ICMP messages
IP-packets.
in the protocol field of the IP header.
Format of ICMP messages
unreachable“)
e.g. timestamps
IP Header [Protocol = 1] ICMP Message Info
Ilab: The basics / Static Routing 14
MAC addresses (also referred to as “physical address”)
Ethernet / WLAN 48 Bit long (z.B.: aa:bb:cc:dd:ee:ff ) Contains information about vendor and product MAC addresses are not hierarchically issued, e.g.:
When MAC addresses would be used for global addressing of devices, routing of packets would not scale as every router would need to know the route to every possible destination
Ilab: The basics / Static Routing 15
IP addresses are 32 bit long this results in 2^32 possible host
addresses
A naive approach would result in huge routing tables, a router would
need to know all routes to all end systems impossible
Better approach: Hierarchical Addressing
network
Effect:
the router that „cares“ for the destination network
Ilab: The basics / Static Routing 16
0 1 2 4 8 16 24 31 1 Net-ID Net-ID 1 1 Net-ID Node-ID Node-ID Node-ID 1 1 1 1 Reserved for future use
1 1 1 Multicast Address
Ilab: The basics / Static Routing 17
Purpose: Split the static Class A, B C networks into parts (subnets) Use:
Implemented with subnetwork masks
Ilab: The basics / Static Routing 18
IP-Address (in this example: Class B , prefix 10, 2/14/16):
Subnetwork mask marks the bits that describe the network and the
represented with a sequence of set bits („1“)
IP-Addresse: 129. 13.
Subnetmask: 255.
1111 1111 1111 1111 1111 1111 0000 0000 Network: 129. 13. Subnetwork: 3. Endsystem: 64
subnetwork is specified. Network Part Network Part Local Part Subnet Part Host Part
Ilab: The basics / Static Routing 20
Diadvantage of fixed address classes:
Example:
CIDR: Replace fixed network classes with network prefixes of
arbitrary length:
first 13 Bits smaller routing tables, smaller costs
Ilab: The basics / Static Routing 22
ARP = Address Resolution Protocol Purpose:
the next hop
hop
ARP cache: a system remembers MAC addresses of recently resolved
IP addresses
Ilab: The basics / Static Routing 23
Source IP 202.34.5.27 MAC ..:f7:a1 Host 1 IP 202.34.5.11 MAC ..:e0:10 Destination IP 84.6.7.8 MAC 7 Host 2 IP 84.6.7.10 MAC 5 Router IP 202.34.5.2 MAC ..:b1:f2 IP 84.6.7.254 MAC 2
Example setup:
Now the sender wants to send a packet to the destination …
Ethernet Some network with 8 bit long MAC addresses
Ilab: The basics / Static Routing 24
Source wants to send a packet to 84.6.7.8 (destination) The destination is not located in the own network
The sender determines the next hop which is the router (default gateway) Result: the next layer 3 hop is the router with the IP 202.34.5.2
The semder first needs to resolve the MAC address of the router
Source IP 202.34.5.27 MAC ..:f7:a1 Host 1 IP 202.34.5.11 MAC ..:e0:10 Destination IP 84.6.7.8 MAC 7 Host 2 IP 84.6.7.10 MAC 5 Router IP 202.34.5.2 MAC ..:b1:f2 IP 84.6.7.254 MAC 2
Ilab: The basics / Static Routing 25
Source IP 202.34.5.27 MAC ..:f7:a1 Host 1 IP 202.34.5.11 MAC ..:e0:10 Destination IP 84.6.7.8 MAC 7 Host 2 IP 84.6.7.10 MAC 5 Router IP 202.34.5.2 MAC ..:b1:f2 IP 84.6.7.254 MAC 2
Ethernet Frame: DST: Broadcast (..:ff:ff) SRC: ..:f7:a1 Type: ARP Address Resolution Protocol (Request) Hardware Type: Ethernet Protocol Type: IP Hardware Size: 6 Protocol Size: 4 Sender MAC: ..:f7:a1 Sender IP: 202.34.5.27 Target MAC: ..:00:00 Target IP: 202.34.5.2
Ilab: The basics / Static Routing 26
Source IP 202.34.5.27 MAC ..:f7:a1 Host 1 IP 202.34.5.11 MAC ..:e0:10 Destination IP 84.6.7.8 MAC 7 Host 2 IP 84.6.7.10 MAC 5 Router IP 202.34.5.2 MAC ..:b1:f2 IP 84.6.7.254 MAC 2
Ethernet Frame: DST: ..:f7:a1 SRC: ..:b1:f2 Type: ARP Address Resolution Protocol (Reply) Hardware Type: Ethernet Protocol Type: IP Hardware Size: 6 Protocol Size: 4 Sender MAC: ..:b1:f2 Sender IP: 202.34.5.2 Target MAC: ..:f7:a1 Target IP: 202.34.5.27
This node will not interfere
Ilab: The basics / Static Routing 27
Source IP 202.34.5.27 MAC ..:f7:a1 Host 1 IP 202.34.5.11 MAC ..:e0:10 Destination IP 84.6.7.8 MAC 7 Host 2 IP 84.6.7.10 MAC 5 Router IP 202.34.5.2 MAC ..:b1:f2 IP 84.6.7.254 MAC 2
Ethernet Frame: DST: ..:b1:f2 SRC: ..:f7:a1 Type: IP Internet Protocol: Source: 202.34. 5.27 Destination: 84. 6. 7. 8 … Payload, Payload, Payload, Payload, Payload, Payload, Payload, Payload, Payload, Payload, Payload, Payload,
The IP packet is forwarded from sender to the router
MAC address
Final destination
Ilab: The basics / Static Routing 28
Source IP 202.34.5.27 MAC ..:f7:a1 Host 1 IP 202.34.5.11 MAC ..:e0:10 Destination IP 84.6.7.8 MAC 7 Host 2 IP 84.6.7.10 MAC 5 Router IP 202.34.5.2 MAC ..:b1:f2 IP 84.6.7.254 MAC 2
The router recognizes, that the destination is directly reachable by him The router now needs the layer 2 address of the destination
Ilab: The basics / Static Routing 29
Source IP 202.34.5.27 MAC ..:f7:a1 Host 1 IP 202.34.5.11 MAC ..:e0:10 Destination IP 84.6.7.8 MAC 7 Host 2 IP 84.6.7.10 MAC 5 Router IP 202.34.5.2 MAC ..:b1:f2 IP 84.6.7.254 MAC 2
L2 Frame: DST: Broadcast (ff) SRC: 2 Type: ARP Address Resolution Protocol (Request) Hardware Type: XY Protocol Type: IP Hardware Size: 1 Protocol Size: 4 Sender MAC: 2 Sender IP: 84.6.7.254 Target MAC: 0 Target IP: 84.6.7.8 In this network, MAC addresses are 1 bit long!
Ilab: The basics / Static Routing 30
Source IP 202.34.5.27 MAC ..:f7:a1 Host 1 IP 202.34.5.11 MAC ..:e0:10 Destination IP 84.6.7.8 MAC 7 Host 2 IP 84.6.7.10 MAC 5 Router IP 202.34.5.2 MAC ..:b1:f2 IP 84.6.7.254 MAC 2
L2 Frame: DST: 2 SRC: 7 Type: ARP Address Resolution Protocol (Reply) Hardware Type: XY Protocol Type: IP Hardware Size: 1 Protocol Size: 4 Sender MAC: 7 Sender IP: 84.6.7.8 Target MAC: 2 Target IP: 84.6.7.254
Ilab: The basics / Static Routing 31
The router obtained the needed information for delivering the packet
Source IP 202.34.5.27 MAC ..:f7:a1 Host 1 IP 202.34.5.11 MAC ..:e0:10 Destination IP 84.6.7.8 MAC 7 Host 2 IP 84.6.7.10 MAC 5 Router IP 202.34.5.2 MAC ..:b1:f2 IP 84.6.7.254 MAC 2
XY MAC Frame: DST: 7 SRC: 2 Type: IP Internet Protocol: Source: 202.34. 5.27 Destination: 84. 6. 7. 8 … Payload, Payload, Payload, Payload, Payload, Payload, Payload, Payload, Payload, Payload, Payload, Payload, Mac address
Final destination
Ilab: The basics / Static Routing 32
aka „Ethereal“ Powerful tool that ...
Very useful for debugging protocols... ... and for understanding them Networker‘s best friend
Ilab: The basics / Static Routing 33
Ilab: The basics / Static Routing 34
Do not get confused. The IP addresses printed here are added as a service from
packet, they do not exist here.
Lehrstuhl für Netzarchitekturen und Netzdienste
Institut für Informatik Technische Universität München
2 ilab: Dynamic Routing
Ciscorouter, IPv4, ICMP, ARP
Session Presentation Application Physical Datalink Network Transport Network Transport Application Host-to-Net TCP/ IP ISO/ OSI
Concepts, Hardware, Software
Minicom
3 ilab: Dynamic Routing
RIP, OSPF, BGP Session Presentation Application Physical Datalink Network Transport Network Transport Application Host-to-Net TCP/ IP ISO/ OSI
Concepts, Hardware, Software
2.4. What did RIP do? 2.5. Changing the setup a little... 2.6. Configuring the serial link 2.7. RIP done.
3.3. Distance values 3.6. Compare: OSPF with and without areas 3.7. Ad-/ Disadvantages of OSPF area routing 3.8. Inspecting OSPF packets
4.1. Autonomous systems Cisco Serial Link
Zebra
4 ilab: Dynamic Routing
Given: Graph
Main problem:
path tree in order to forward packets to their destination
Subproblems:
Routing algorithms solve subproblems 1 and 2
A E D C B F
2 2 1 3 1 1 2 5 3 5
5 ilab: Dynamic Routing
Approach
Information gathering
routing information (destination, costs)
Path calculation
has changed
Outcome
changed
A E D C B F
2 2 1 3 1 1 2 5 3 5
B costs 2 C costs 4 D costs 1 E costs 2 F costs 4 A costs 1 B costs 2 C costs 3 E costs 1 F costs 3
?
6 ilab: Dynamic Routing
D () A B C D A 1 7 6 4 B 15 8 9 11 D 5 5 4 2
E
Costs to destination via
7 8 1 2 1 2
A B C D E
D (Y,Z)
X Distance from X to Y via Z c(X,Z) + min {D (Y,w)}
Z
= =
D (C,D)
E
c(E,D) + min {D (C,w)}
D w
=
= 2+2 = 4
Loop!
Example
Distance table contains unwanted routes
D (C,A)
E
c(E,A) + min {D (C,w)}
A w
=
= 1+5 = 6
7 ilab: Dynamic Routing
E costs via
Exit link, costs
8 ilab: Dynamic Routing
Rule:
good news travels fast bad news travels slowly - “count to infinity” problem!
Y: direct link to X changed -> Use route via Z (loop) Y: Propagates new route to X Z: Updates costs to X via Y
X
1 4 50 60
etc.
Y Z
9 ilab: Dynamic Routing
Situation
Split-Horizon
would route via D
Poison Reverse
is set to infinity
Path vector routing
information in their update messages
A E D C B F
2 2 1 3 1 1 2 5 3 5
B costs 2 C costs ∞ D costs ∞ E costs ∞ F costs ∞
10 ilab: Dynamic Routing
Approach
Information gathering
topology due to the broadcasting of link properties
Path calculation
path tree (itself being the root of the tree)
Dijkstra or Bellman-Ford
path tree
Result: Routing table
A E D C B F
2 2 1 3 1 1 2 5 3 5
Flooding
A E D C B F
2 1 1 2 1
Shortest Path tree B B C-F D to via
11 ilab: Dynamic Routing
In practice, nodes use a forward search alogorithm based on the
All nodes flood the network with their Link State Packets (LSP) Nodes maintain a tentative and a confirmed list and calculate the
routing table directly after receiving the LSPs A C B
2 4 1 8 3
D
12 ilab: Dynamic Routing
Step 1 2 3 4 5 6 7 confirmed (D,0,-) (D,0,-) (D,0,-) (A,1,A) (D,0,-) (A,1,A) (D,0,-) (A,1,A) (B,3,A) (D,0,-) (A,1,A) (B,3,A) (D,0,-) (A,1,A) (B,3,A) (C,6,A) tentativ (A,1,A) (B,4,B) (C,8,C) (B,4,B) (C,8,C) (B,3,A) (C,8,C) (C,8,C) (C,6,A) Notes Read LSP of D populate tentative list Add the least expensive entry to the confirmed list (here A) Read its LSP and update the entries (here: path to B) Add the least expensive entry to the confirmed list Read its LSP and update the entries (here: route to C) Add the least expensive entry to the confirmed list
A C B
2 4 1 8 3
D
13 ilab: Dynamic Routing
14 ilab: Dynamic Routing 14
Autonomes System (AS): Networks under one administrative
Changes within the AS not relevant for other systems
Each AS may have a different internal routing protocol Routing between AS‘s: inter-domain routing protocols Each AS is identified by a 16bit AS number
15 ilab: Dynamic Routing
AS X AS A AS D AS Z AS B AS C
Inter-AS- connection
Border Router Autonomous System X
AS X
Stub-AS Multihomed AS
Transittraffic
16 ilab: Dynamic Routing
Autonomous System (AS):
Networks under one administrative organization
Interior Gateway (IG):
Internal routers of an AS
Exterior Gateway (EG):
Border routers Core Network EG EG IG IG IG IG
AS AS
IG
Interior Gateway Protocols (IGP) Exterior Gateway Protocols (EGP) Routing in the internet
17 ilab: Dynamic Routing
Intra-Domain-Routing:
Inter-Domain-Routing:
(CIDR)
18 ilab: Dynamic Routing
Distance-Vektor-Verfahren
since 1982 in BSD-UNIX
Metric: # of Hops (max = 15 Hops)
Distance vectors: updates/advertisements are sent every 30s via UDP
Each advertisement contains routes to max. 25 destination networks
Link declared unreachable after 180s without an update
19 ilab: Dynamic Routing
Link-State-Protocol OSPF-Advertisements contain one entry per neighboring node Advertisements are flooded to the whole AS Security: all OSPF messages are authenticated Hierarchical OSPF for large AS
20 ilab: Dynamic Routing
21 ilab: Dynamic Routing
BGP (Border Gateway Protocol) Standard protocol in the internet Path-Vector-Protocol:
(sequence of AS numbers)
Neighbors decide based on policies and costs which path to use
22 ilab: Dynamic Routing
Policy:
through the network
Scalablity:
needed for exchanging routing information
Performance:
23 ilab: Dynamic Routing