Network Layerطبقة الشبكة

الشريحة 1 من 32

مقدمة الفصل

ماذا ستتعلم في هذا الفصل

  1. Understand principles behind network layer services: network layer service models, forwarding versus routing, how a router works, routing (path selection).
  2. Instantiation, implementation in the Internet: IP (datagram format, IPv4 addressing, ICMP, IPv6) and routing in the Internet (RIP, OSPF, BGP).
  3. Routing algorithms: link state, distance vector, hierarchical routing.

أقسام الفصل

  1. 1Network layer: functions and service modelطبقة الشبكة: الوظائف ونموذج الخدمة
  2. 2Virtual circuit and datagram networksشبكات الدارة الافتراضية وشبكات الداتاجرام
  3. 3Router architecture overviewنظرة على معمارية الموجّه
  4. 4The Internet network layer and the IP datagram formatطبقة الشبكة في الإنترنت وصيغة داتاجرام IP
  5. 5IP fragmentation and reassemblyتجزئة IP وإعادة التجميع
  6. 6IP addressing, subnets and CIDRعنونة IP والشبكات الفرعية وCIDR
  7. 7DHCP: Dynamic Host Configuration Protocolبروتوكول DHCP
  8. 8Getting address blocks: hierarchical addressing and ICANNكتل العناوين والعنونة الهرمية وICANN
  9. 9NAT: network address translationترجمة عناوين الشبكة NAT
  10. 10ICMP and tracerouteICMP وtraceroute
  11. 11IPv6 and the transition from IPv4IPv6 والانتقال من IPv4
  12. 12Routing algorithms: graph abstraction and classificationخوارزميات التوجيه: الرسم البياني والتصنيف
  13. 13Link-state routing: Dijkstra's algorithmتوجيه حالة الرابط: خوارزمية ديكسترا
  14. 14Distance vector routing; LS vs DVتوجيه متجه المسافة ومقارنته بحالة الرابط
  15. 15Hierarchical routing and autonomous systemsالتوجيه الهرمي والأنظمة المستقلة
  16. 16Intra-AS routing: RIPالتوجيه داخل النظام: RIP
  17. 17OSPF (Open Shortest Path First)بروتوكول OSPF
  18. 18BGP and why intra- and inter-AS routing differBGP ولماذا يختلف التوجيه الداخلي عن الخارجي

تلميح: استخدم أسهم لوحة المفاتيح للتنقل بين الشرائح.

تفاصيل المصدرالفصل 4 · الشريحة ⁦2⁩
المصدر
الفصل 4 · الشريحة ⁦2⁩
ملاحظات حول المصدر (1)
  • تذكر الشريحة 91 البث العام والمتعدد، لكن لا توجد شرائح عنهما. وفي الشريحة 20 خطأ: الإزاحة 370 للجزء الثالث لا الثاني.

Network layer: two key functionsوظيفتا طبقة الشبكة

Network layer: functions and service model

  • Transports segment from sending to receiving host: on sending side encapsulates segments into datagrams; on receiving side delivers segments to transport layer.
  • Network layer protocols in every host, router; router examines header fields in all IP datagrams passing through it.

Forwardingالتمرير

  • Move packets from router's input to appropriate router output
  • Analogy: process of getting through single interchange
  • Forwarding table determines local forwarding at this router

Routingالتوجيه

  • Determine route taken by packets from source to dest.
  • Analogy: process of planning trip from source to dest
  • Routing algorithm determines end-end-path through network

من الشرائح

  • Slide 5: a local forwarding table maps header values to output links (0100 → 3, 0101 → 2, 0111 → 2, 1001 → 1); an arriving packet with header 0111 leaves on link 2.
تفاصيل المصدرالفصل 4 · الشرائح ⁦3–5⁩
المصدر
الفصل 4 · الشرائح ⁦3–5⁩

Connection setup and service modelsإنشاء الاتصال ونماذج الخدمة

Network layer: functions and service model

Connection setup
3rd important function in some network architectures (ATM, frame relay, X.25): before datagrams flow, two end hosts and intervening routers establish virtual connection — routers get involved.
Network vs transport layer connection service

Network

  • Between two hosts
  • May also involve intervening routers in case of VCs

Transport

  • Between two processes
Network service model: example services (slide 7)

For individual datagrams

  • Guaranteed delivery
  • Guaranteed delivery with less than 40 msec delay

For a flow of datagrams

  • In-order datagram delivery
  • Guaranteed minimum bandwidth to flow
  • Restrictions on changes in inter-packet spacing
تفاصيل المصدرالفصل 4 · الشرائح ⁦6–7⁩
المصدر
الفصل 4 · الشرائح ⁦6–7⁩

Datagram vs virtual-circuit networksالداتاجرام والدارات الافتراضية

Virtual circuit and datagram networks

Datagram network
Provides network-layer connectionless service.
Virtual-circuit network
Provides network-layer connection service.

Analogous to TCP/UDP services, but:

  • Service: host-to-host
  • No choice: network provides one or the other
  • Implementation: in network core
Datagram or VC network: why? (slide 10)
Internet (datagram)ATM (VC)
Origin / traffic
  • Data exchange among computers
  • "elastic" service, no strict timing req.
  • Evolved from telephony
  • human conversation: strict timing, reliability requirements
End systems"Smart" end systems (computers): can adapt, perform control, error recovery"Dumb" end systems: telephones
Where complexity isSimple inside network, complexity at "edge"Complexity inside network
Links / service
  • Many link types, different characteristics
  • uniform service difficult
Need for guaranteed service

Which statement describes the ATM (VC) design philosophy rather than the Internet's?

تفاصيل المصدرالفصل 4 · الشرائح ⁦9–10⁩
المصدر
الفصل 4 · الشرائح ⁦9–10⁩

Router architecture overviewمعمارية الموجّه

  1. 1Run routing algorithms/protocol (RIP, OSPF, BGP)
  2. 2Forwarding datagrams from incoming to outgoing link

Routing, management control plane (software)

  • Routing processor
  • Forwarding tables computed, pushed to input ports

Forwarding data plane (hardware)

  • Router input ports
  • High-speed switching fabric
  • Router output ports
تفاصيل المصدرالفصل 4 · الشريحة ⁦12⁩
المصدر
الفصل 4 · الشريحة ⁦12⁩

IP datagram formatصيغة داتاجرام IP

The Internet network layer (slide 14)

  • Routing protocols: path selection — RIP, OSPF, BGP → forwarding table
  • IP protocol: addressing conventions, datagram format, packet handling conventions
  • ICMP protocol: error reporting, router "signaling"
IP datagram format (slide 15)
FieldMeaning (slide 15)
verIP protocol version number
head. lenHeader length (bytes)
type of service"Type" of data
lengthTotal datagram length (bytes)
16-bit identifier, flgs, fragment offsetFor fragmentation/reassembly
time to liveMax number remaining hops (decremented at each router)
upper layerUpper layer protocol to deliver payload to
header checksumChecksum over the header
source / destination IP address32 bits each
options (if any)e.g. timestamp, record route taken, specify list of routers to visit
dataVariable length, typically a TCP or UDP segment

Which IP header field limits how many more routers a datagram may pass through, being decremented at each router?

تفاصيل المصدرالفصل 4 · الشرائح ⁦14–15⁩
المصدر
الفصل 4 · الشرائح ⁦14–15⁩

IP fragmentation and reassemblyالتجزئة

MTU (max. transfer size)
Largest possible link-level frame. Different link types, different MTUs.
  1. 1

    A large IP datagram is divided ("fragmented") within the net.

  2. 2

    One datagram becomes several datagrams.

  3. 3

    They are "reassembled" only at final destination.

  4. 4

    IP header bits are used to identify, order related fragments.

تفاصيل المصدرالفصل 4 · الشريحة ⁦16⁩
المصدر
الفصل 4 · الشريحة ⁦16⁩

Fragmentation example: 4000 bytes, MTU 1500مثال التجزئة

IP fragmentation and reassembly

المسألة

4000 byte datagram (including a 20-byte IP header) over a link with MTU = 1500 bytes

المعطيات

Payload
4000 − 20 = 3980 bytes
Per full fragment
1500 = 20 (header) + 1480 (data)
FragmentlengthIDfragflagoffsetData bytes
Original4000x003980 (4000 − 20)
1st1500x101480 (starts at byte 0)
2nd1500x11851480 (starts at byte 1480)
3rd1040x03701020 (starts at byte 2960)

A 2400-byte IP datagram (including a 20-byte header) must cross a link with MTU = 700 bytes. How many fragments are produced, and what is the offset of the last one?

تفاصيل المصدرالفصل 4 · الشرائح ⁦17–20⁩
المصدر
الفصل 4 · الشرائح ⁦17–20⁩
ملاحظات حول المصدر (1)
  • تقول الشريحة 20 «الحزمة الثانية» للإزاحة 370، والصحيح الجزء الثالث.

IP addresses and interfacesالعناوين والواجهات

IP addressing, subnets and CIDR

IP addressعنوان IP
32-bit identifier for host, router interface.
Interfaceالواجهة
Connection between host/router and physical link. IP addresses associated with each interface.
  • Routers typically have multiple interfaces.
  • A host typically has one or two interfaces (e.g., wired Ethernet, wireless 802.11).
  • Example: 223.1.1.1 = 11011111 00000001 00000001 00000001.
  • Wired Ethernet interfaces are connected by Ethernet switches; wireless WiFi interfaces by a WiFi base station.
تفاصيل المصدرالفصل 4 · الشرائح ⁦22–23⁩
المصدر
الفصل 4 · الشرائح ⁦22–23⁩

Subnets and CIDRالشبكات الفرعية وCIDR

Two parts of an IP address

Subnet part

  • High order bits

Host part

  • Low order bits
Subnet
Device interfaces with same subnet part of IP address; can physically reach each other without intervening router.
Recipe (slide 25)
To determine the subnets, detach each interface from its host or router, creating islands of isolated networks; each isolated network is called a subnet (e.g., 223.1.1.0/24, 223.1.2.0/24, 223.1.3.0/24 — subnet mask: /24).
CIDR: Classless InterDomain Routing
Subnet portion of address of arbitrary length; address format a.b.c.d/x, where x is # bits in subnet portion of address. Example: 200.23.16.0/23.

For the CIDR address 200.23.16.0/23, how many bits form the host part?

تفاصيل المصدرالفصل 4 · الشرائح ⁦24, 25, 27⁩
المصدر
الفصل 4 · الشرائح ⁦24, 25, 27⁩

DHCPDHCP

How does a host get an IP address?

Hard-coded

  • By system admin in a file
  • Windows: control-panel→network→configuration→tcp/ip→properties
  • UNIX: /etc/rc.config

DHCP

  • Dynamically get address from as server
  • "Plug-and-play"

DHCP goal

  • Allow host to dynamically obtain its IP address from network server when it joins network
  • Can renew its lease on address in use
  • Allows reuse of addresses (only hold address while connected/"on")
  • Support for mobile users who want to join network

DHCP overview

  1. discover

    Host broadcasts "DHCP discover" msg [optional]

  2. offer

    DHCP server responds with "DHCP offer" msg [optional]

  3. request

    Host requests IP address: "DHCP request" msg

  4. ack

    DHCP server sends address: "DHCP ack" msg

من الشرائح

  • Slide 31: client messages go from 0.0.0.0, port 68 to 255.255.255.255, port 67; the server (223.1.2.5) answers from port 67 to 255.255.255.255, port 68; the address offered and confirmed is 223.1.2.4, lifetime 3600 secs.

DHCP client-server scenario (slide 30)

  • Three subnets joined by one router — 223.1.1.0/24 (hosts 223.1.1.1–.3, router interface 223.1.1.4), 223.1.2.0/24 (hosts 223.1.2.1, 223.1.2.2, router 223.1.2.9, the DHCP server) and 223.1.3.0/24 (hosts 223.1.3.1, 223.1.3.2, router 223.1.3.27). An arriving DHCP client needs an address in this network (223.1.2.0/24).

Which is the correct order of the DHCP messages?

تفاصيل المصدرالفصل 4 · الشرائح ⁦28, 29, 31⁩
المصدر
الفصل 4 · الشرائح ⁦28, 29, 31⁩

DHCP: more than IP addressesما يقدمه DHCP أيضًا

DHCP: Dynamic Host Configuration Protocol

DHCP can return more than the allocated IP address

  • Address of first-hop router for client
  • Name and IP address of DNS server
  • Network mask (indicating network versus host portion of address)

Example: a connecting laptop (slides 33–34)

  1. 1

    DHCP request encapsulated in UDP, encapsulated in IP, encapsulated in 802.1 Ethernet.

  2. 2

    Ethernet frame broadcast (dest: FFFFFFFFFFFF) on LAN, received at router running DHCP server.

  3. 3

    Ethernet demuxed to IP, IP demuxed to UDP, UDP demuxed to DHCP.

  4. 4

    DHCP server formulates DHCP ACK containing client's IP address, IP address of first-hop router for client, name & IP address of DNS server.

  5. 5

    Frame forwarded to client, demuxing up to DHCP at client. Client now knows its IP address, DNS server and first-hop router.

تفاصيل المصدرالفصل 4 · الشرائح ⁦32–34⁩
المصدر
الفصل 4 · الشرائح ⁦32–34⁩

Hierarchical addressing and ICANNالعنونة الهرمية

A network gets an allocated portion of its provider ISP's address space (slide 35)
BlockAddress
ISP's block200.23.16.0/20
Organization 0200.23.16.0/23
Organization 1200.23.18.0/23
Organization 2200.23.20.0/23
……
Organization 7200.23.30.0/23
Route aggregation
Hierarchical addressing allows efficient advertisement of routing information: Fly-By-Night-ISP advertises "Send me anything with addresses beginning 200.23.16.0/20".
More specific routes
If Organization 1 moves to ISPs-R-Us, ISPs-R-Us advertises "Send me anything with addresses beginning 199.31.0.0/16 or 200.23.18.0/23" — a more specific route to Organization 1.
ICANN
Internet Corporation for Assigned Names and Numbers: allocates addresses, manages DNS, assigns domain names, resolves disputes.
تفاصيل المصدرالفصل 4 · الشرائح ⁦35–38⁩
المصدر
الفصل 4 · الشرائح ⁦35–38⁩

NAT: network address translationNAT

All datagrams leaving the local network have the same single source NAT IP address (138.76.29.7), with different source port numbers. Inside, datagrams use 10.0.0/24 addresses as usual.

Motivation: one IP address as far as the outside world is concerned

  • Range of addresses not needed from ISP: just one IP address for all devices
  • Can change addresses of devices in local network without notifying outside world
  • Can change ISP without changing addresses of devices in local network
  • Devices inside local net not explicitly addressable, visible by outside world (a security plus)

NAT router must:

  1. Outgoing

    Replace (source IP address, port #) of every outgoing datagram with (NAT IP address, new port #).

  2. Remember

    Store every (source IP address, port #) ↔ (NAT IP address, new port #) pair in the NAT translation table.

  3. Incoming

    Replace (NAT IP address, new port #) in the dest fields with the corresponding (source IP address, port #) from the table.

تفاصيل المصدرالفصل 4 · الشرائح ⁦39–41⁩
المصدر
الفصل 4 · الشرائح ⁦39–41⁩

NAT example; why NAT is controversialمثال NAT وجدله

NAT: network address translation

Slide 42

  1. 1

    Host 10.0.0.1 sends datagram to 128.119.40.186, 80 (S: 10.0.0.1, 3345).

  2. 2

    NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table.

  3. 3

    Reply arrives: dest. address 138.76.29.7, 5001.

  4. 4

    NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345.

  • 16-bit port-number field: 60,000 simultaneous connections with a single LAN-side address!

NAT is controversial

  • Routers should only process up to layer 3
  • Violates end-to-end argument — NAT possibility must be taken into account by app designers, e.g., P2P applications
  • Address shortage should instead be solved by IPv6

Host 10.0.0.2 sends a datagram from port 4000 to a web server. The NAT router (public address 138.76.29.7) chooses new port 6001. What source address and port does the web server see, and what does the reply's destination look like before the NAT router changes it?

تفاصيل المصدرالفصل 4 · الشرائح ⁦42–43⁩
المصدر
الفصل 4 · الشرائح ⁦42–43⁩

ICMPICMP

ICMP: internet control message protocol
Used by hosts & routers to communicate network-level information: error reporting (unreachable host, network, port, protocol) and echo request/reply (used by ping).
  • Network-layer "above" IP: ICMP msgs carried in IP datagrams.
  • ICMP message: type, code plus first 8 bytes of IP datagram causing error.
ICMP types and codes (slide 45)
TypeCodeDescription
00echo reply (ping)
30dest. network unreachable
31dest host unreachable
32dest protocol unreachable
33dest port unreachable
36dest network unknown
37dest host unknown
40source quench (congestion control - not used)
80echo request (ping)
90route advertisement
100router discovery
110TTL expired
120bad IP header
تفاصيل المصدرالفصل 4 · الشريحة ⁦45⁩
المصدر
الفصل 4 · الشريحة ⁦45⁩

Traceroute and ICMPtraceroute

ICMP and traceroute

  1. 1

    Source sends a series of UDP segments to dest, with an unlikely port number: first set has TTL = 1, second set has TTL = 2, etc. (3 probes per set).

  2. 2

    When the nth set arrives at the nth router, the router discards the datagrams and sends the source ICMP messages (type 11, code 0), including the router's name & IP address.

  3. 3

    When the ICMP messages arrive, the source records RTTs.

  4. 4

    Stopping criteria: the UDP segment eventually arrives at the destination host, which returns an ICMP "port unreachable" message (type 3, code 3); the source stops.

During traceroute, a probe reaches the destination host itself. Which ICMP message comes back, and what does the source do?

تفاصيل المصدرالفصل 4 · الشريحة ⁦46⁩
المصدر
الفصل 4 · الشريحة ⁦46⁩

IPv6IPv6

Priority
Identify priority among datagrams in flow.
Flow label
Identify datagrams in same "flow" (concept of "flow" not well defined).
Next header
Identify upper layer protocol for data.
Addresses
Source address (128 bits); destination address (128 bits).

Other changes from IPv4

  • Checksum: removed entirely to reduce processing time at each hop
  • Options: allowed, but outside of header, indicated by "Next Header" field
  • ICMPv6: new version of ICMP — additional message types, e.g. "Packet Too Big"; multicast group management functions

Why was the header checksum removed in IPv6?

تفاصيل المصدرالفصل 4 · الشرائح ⁦47–48⁩
المصدر
الفصل 4 · الشرائح ⁦47–48⁩

Transition from IPv4 to IPv6: tunnelingالانتقال والنفق

IPv6 and the transition from IPv4

  • Not all routers can be upgraded simultaneously — no "flag days".
  • How will the network operate with mixed IPv4 and IPv6 routers?
Tunneling
IPv6 datagram carried as payload in IPv4 datagram among IPv4 routers.

Example (slide 51): IPv6 routers A, B, E, F; IPv4 routers C, D

  1. A-to-B

    IPv6 datagram: flow X, src A, dest F, data.

  2. B-to-C … to E

    IPv6 inside IPv4: IPv4 header src B, dest E; payload = the IPv6 datagram.

  3. E-to-F

    IPv6 datagram again: flow X, src A, dest F, data.

تفاصيل المصدرالفصل 4 · الشرائح ⁦49–51⁩
المصدر
الفصل 4 · الشرائح ⁦49–51⁩

Graph abstraction and routing classificationالرسم البياني والتصنيف

Routing algorithms: graph abstraction and classification

Graph: G = (N,E)

  • N = set of routers = { u, v, w, x, y, z }
  • E = set of links = { (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
  • c(x,x') = cost of link (x,x'), e.g., c(w,z) = 5; cost could always be 1, or inversely related to bandwidth, or to congestion
  • Cost of path (x1, …, xp) = c(x1,x2) + c(x2,x3) + … + c(xp−1,xp)
Routing algorithm
Algorithm that finds the least cost path (e.g., between u and z).
Routing algorithm classification (slide 56)

Global ("link state")

  • All routers have complete topology, link cost info

Decentralized ("distance vector")

  • Router knows physically-connected neighbors, link costs to neighbors
  • Iterative process of computation, exchange of info with neighbors

Static

  • Routes change slowly over time

Dynamic

  • Routes change more quickly
  • Periodic update; in response to link cost changes
تفاصيل المصدرالفصل 4 · الشرائح ⁦54–56⁩
المصدر
الفصل 4 · الشرائح ⁦54–56⁩

Dijkstra's algorithmخوارزمية ديكسترا

  • Net topology, link costs known to all nodes — via "link state broadcast"; all nodes have same info.
  • Computes least cost paths from one node ("source") to all other nodes — gives forwarding table for that node.
  • Iterative: after k iterations, know least cost path to k dest.'s.
c(x,y)
Link cost from node x to y; = ∞ if not direct neighbors.
D(v)
Current value of cost of path from source to dest. v.
p(v)
Predecessor node along path from source to v.
N'
Set of nodes whose least cost path definitively known.

Algorithm (slide 59)

  1. Init

    N' = {u}; for all nodes v: D(v) = c(u,v) if v adjacent to u, else ∞.

  2. Loop

    Find w not in N' such that D(w) is a minimum; add w to N'.

  3. Update

    For all v adjacent to w and not in N': D(v) = min( D(v), D(w) + c(w,v) ).

  4. Until

    All nodes in N'.

تفاصيل المصدرالفصل 4 · الشرائح ⁦58–59⁩
المصدر
الفصل 4 · الشرائح ⁦58–59⁩

Dijkstra's algorithm: worked exampleمثال ديكسترا

Link-state routing: Dijkstra's algorithm

Dijkstra's algorithm from u (slide 61)
StepN'D(v),p(v)D(w),p(w)D(x),p(x)D(y),p(y)D(z),p(z)
0u2,u5,u1,u∞∞
1ux2,u4,x2,x∞
2uxy2,u3,y4,y
3uxyv3,y4,y
4uxyvw4,y
5uxyvwz
Dijkstra's algorithm: second example (slide 60). Links: u–w 3, u–x 5, u–v 7, w–x 4, w–v 3, w–y 8, x–y 7, x–z 9, v–y 4, y–z 2. Each cell is D(·),p(·); the circled (chosen) entry of each step is in bold.
StepN'D(v),p(v)D(w),p(w)D(x),p(x)D(y),p(y)D(z),p(z)
0u7,u3,u5,u∞∞
1uw6,w5,u11,w∞
2uwx6,w11,w14,x
3uwxv10,v14,x
4uwxvy12,y
5uwxvyz
  • Update rule on slide 60: D(v) = min( D(v), D(w) + c(w,v) ); e.g. D(z) = min( D(z), D(y) + c(y,z) ) = min(14, (10+2)) = 12.
  • The resulting least-cost paths (red on slide 60): u→x, u→w, w→v, v→y, y→z.

Resulting forwarding table in u (slide 62)

  • v → link (u,v)
  • x, y, w, z → link (u,x)

Discussion (slide 63)

  • n nodes: each iteration checks all nodes not in N; n(n+1)/2 comparisons: O(n²); more efficient implementations possible: O(n log n).
  • Oscillations possible, e.g., if link cost equals amount of carried traffic.

A network has these links and costs: u–v 2, u–x 1, u–w 5, v–x 2, v–w 3, x–w 3, x–y 1, w–y 1, w–z 5, y–z 2. Running Dijkstra's algorithm from source u, what is the least cost to w, and through which first link does u forward packets to w?

تفاصيل المصدرالفصل 4 · الشرائح ⁦60–63⁩
المصدر
الفصل 4 · الشرائح ⁦60–63⁩

Distance vector: Bellman-Fordمتجه المسافة

Distance vector routing; LS vs DV

Bellman-Ford equation (dynamic programming)
dx(y) = min over neighbors v of { c(x,v) + dv(y) } — the least cost from x to y. c(x,v): cost to neighbor v; dv(y): cost from neighbor v to destination y.

المسألة

Slide 66: dv(z) = 5, dx(z) = 3, dw(z) = 3; c(u,v) = 2, c(u,x) = 1, c(u,w) = 5

Distance vector algorithm

  • From time-to-time, each node sends its own distance vector estimate to neighbors.
  • When x receives a new DV from a neighbor, it updates its own DV using B-F: Dx(y) ← min_v{c(x,v) + Dv(y)}.
  • Iterative, asynchronous: each local iteration is caused by a local link cost change or a DV update message from a neighbor.
  • Distributed: each node notifies neighbors only when its DV changes; neighbors then notify their neighbors if necessary.

Node x has neighbors y and z with c(x,y) = 4 and c(x,z) = 9. Their distance vectors say Dy(z) = 2 and Dz(z) = 0. Using Bellman-Ford, what is Dx(z), and what is the next hop?

تفاصيل المصدرالفصل 4 · الشرائح ⁦65–69⁩
المصدر
الفصل 4 · الشرائح ⁦65–69⁩

Distance vector: the x, y, z exampleمثال متجه المسافة

Distance vector routing; LS vs DV

Slide 71: three nodes with links x–y 2, y–z 1, x–z 7. Each node's table holds its own distance vector (row "from" itself) and the vectors it has received from neighbours ("cost to" x, y, z). Time runs left to right.

Node x table over time
Start: from x / y / zAfter receiving y, z vectorsFinal
x0 2 70 2 30 2 3
y∞ ∞ ∞2 0 12 0 1
z∞ ∞ ∞7 1 03 1 0
Node y table over time
StartAfter receiving x, z vectorsFinal
x∞ ∞ ∞0 2 70 2 3
y2 0 12 0 12 0 1
z∞ ∞ ∞7 1 03 1 0
Node z table over time
StartAfter receiving x, y vectorsFinal
x∞ ∞ ∞0 2 70 2 3
y∞ ∞ ∞2 0 12 0 1
z7 1 03 1 03 1 0
  • Dx(y) = min{ c(x,y) + Dy(y), c(x,z) + Dz(y) } = min{2+0, 7+1} = 2.
  • Dx(z) = min{ c(x,y) + Dy(z), c(x,z) + Dz(z) } = min{2+1, 7+0} = 3.
تفاصيل المصدرالفصل 4 · الشريحة ⁦71⁩
المصدر
الفصل 4 · الشريحة ⁦71⁩

Comparison of LS and DV algorithmsمقارنة LS وDV

Distance vector routing; LS vs DV

Comparison of LS and DV algorithms (slide 72)
Link state (LS)Distance vector (DV)
Message complexityWith n nodes, E links, O(nE) msgs sent
  • Exchange between neighbors only
  • convergence time varies
Speed of convergence
  • O(n²) algorithm requires O(nE) msgs
  • may have oscillations
  • Convergence time varies
  • may be routing loops
  • count-to-infinity problem
Robustness (router malfunctions)
  • Node can advertise incorrect link cost
  • each node computes only its own table
  • DV node can advertise incorrect path cost
  • each node's table used by others — error propagates thru network
تفاصيل المصدرالفصل 4 · الشريحة ⁦72⁩
المصدر
الفصل 4 · الشريحة ⁦72⁩

Hierarchical routing: autonomous systemsالأنظمة المستقلة

Hierarchical routing and autonomous systems

Why the "flat" idealization fails (slide 74)

Scale

  • With 600 million destinations: can't store all dest's in routing tables
  • Routing table exchange would swamp links

Administrative autonomy

  • Internet = network of networks
  • Each network admin may want to control routing in its own network
Autonomous systems (AS)
Regions of aggregated routers. Routers in same AS run same routing protocol ("intra-AS" routing protocol); routers in different AS can run different intra-AS protocols.
Gateway router
At "edge" of its own AS; has link to router in another AS.
  • Forwarding table configured by both intra- and inter-AS routing: intra-AS sets entries for internal dests; inter-AS & intra-AS set entries for external dests.
تفاصيل المصدرالفصل 4 · الشرائح ⁦74–76⁩
المصدر
الفصل 4 · الشرائح ⁦74–76⁩

Inter-AS tasks and hot potato routingالمهام بين الأنظمة

Hierarchical routing and autonomous systems

  1. 1Learn which dests are reachable through AS2, which through AS3
  2. 2Propagate this reachability info to all routers in AS1

من الشرائح

  • Slide 78: AS1 learns subnet x is reachable via AS3 (gateway 1c) but not AS2; router 1d finds from intra-AS info that its interface I is on the least-cost path to 1c and installs forwarding entry (x, I).

Hot potato routing (slide 80): send packet towards closest of two routers

  1. 1

    Learn from inter-AS protocol that subnet x is reachable via multiple gateways.

  2. 2

    Use routing info from intra-AS protocol to determine costs of least-cost paths to each of the gateways.

  3. 3

    Hot potato routing: choose the gateway that has the smallest least cost.

  4. 4

    Determine from forwarding table the interface I that leads to least-cost gateway. Enter (x, I) in forwarding table.

AS1 learns that subnet x is reachable through two gateways. Router 1d's least-cost path is 3 to gateway 1b and 5 to gateway 1c. Under hot potato routing, which gateway does 1d use for x?

تفاصيل المصدرالفصل 4 · الشرائح ⁦77–80⁩
المصدر
الفصل 4 · الشرائح ⁦77–80⁩

RIP (Routing Information Protocol)RIP

Intra-AS routing: RIP

Intra-AS routing = interior gateway protocols (IGP)

  • RIP: Routing Information Protocol
  • OSPF: Open Shortest Path First
  • IGRP: Interior Gateway Routing Protocol (Cisco proprietary)
  1. Algorithm
  2. Metric
  3. Exchange
  4. Advertisement size
  5. Who runs it
تفاصيل المصدرالفصل 4 · الشرائح ⁦82, 83, 86⁩
المصدر
الفصل 4 · الشرائح ⁦82, 83, 86⁩

RIP example: processing an advertisementمثال RIP

Intra-AS routing: RIP

A-to-D advertisement (slide 85)

  • w: next -, 1 hop
  • x: next -, 1 hop
  • z: next C, 4 hops
Routing table in router D (slides 84–85)
Destination subnetNext router (before)# hops (before)After A's advertisement
wA2unchanged (A, 2)
yB2unchanged (B, 2)
zB7
  • A, 5 (A advertises z at 4
  • 4 + 1 = 5 < 7)
x--1unchanged (directly attached)

المسألة

D currently reaches z via B in 7 hops. A advertises z at 4 hops, and D–A is one hop.

Router K reaches subnet S via neighbor M in 9 hops. Neighbor N, one hop away, advertises S at 3 hops. Following RIP, what does K do?

تفاصيل المصدرالفصل 4 · الشرائح ⁦84–85⁩
المصدر
الفصل 4 · الشرائح ⁦84–85⁩

OSPFOSPF

  • "Open": publicly available.
  • Uses link state algorithm: LS packet dissemination; topology map at each node; route computation using Dijkstra's algorithm.
  • OSPF advertisement carries one entry per neighbor; advertisements flooded to entire AS.
  • Carried in OSPF messages directly over IP (rather than TCP or UDP).
  • IS-IS routing protocol: nearly identical to OSPF.
RIP vs OSPF, from slides 83–88
RIPOSPF
AlgorithmDistance vector
  • Link state
  • Dijkstra's algorithm
Metric# hops (max 15), each link cost 1
  • Link costs
  • multiple cost metrics per link for different TOS
Advertisements
  • To neighbors every 30 sec
  • up to 25 destination subnets
  • One entry per neighbor
  • flooded to entire AS
Carried inUDP packets (route-d process)OSPF messages directly over IP
Same-cost pathsOnly one pathMultiple same-cost paths allowed
Securityلا تذكر الشرائح شيئًا هنا.All OSPF messages authenticated

Which feature belongs to OSPF but NOT to RIP?

تفاصيل المصدرالفصل 4 · الشرائح ⁦87–88⁩
المصدر
الفصل 4 · الشرائح ⁦87–88⁩

BGP; why intra- and inter-AS routing differBGP

BGP and why intra- and inter-AS routing differ

BGP (Border Gateway Protocol)
The de facto inter-domain routing protocol — "glue that holds the Internet together".
eBGP
Obtain subnet reachability information from neighboring ASs.
iBGP
Propagate reachability information to all AS-internal routers.
Route choice
Determine "good" routes to other networks based on reachability information and policy.
  • BGP allows a subnet to advertise its existence to rest of Internet: "I am here".
Why different intra-, inter-AS routing? (slide 90)
Intra-ASInter-AS
PolicySingle admin, so no policy decisions neededAdmin wants control over how its traffic routed, who routes through its net
PerformanceCan focus on performancePolicy may dominate over performance
ScaleHierarchical routing saves table size, reduced update trafficHierarchical routing saves table size, reduced update traffic
تفاصيل المصدرالفصل 4 · الشرائح ⁦89–90⁩
المصدر
الفصل 4 · الشرائح ⁦89–90⁩

الخلاصة

أنهيت الدرس

الخطوة التالية: ثبّت المعلومات بالبطاقات، ثم اختبر نفسك بالأسئلة.

ما راجعته في هذا الدرس

تفاصيل المصدرالفصل 4 · الشريحة ⁦91⁩
المصدر
الفصل 4 · الشريحة ⁦91⁩

خريطة الفصل

    1. 1مقدمة الفصل
  1. Network layer: functions and service modelطبقة الشبكة: الوظائف ونموذج الخدمة

    1. 2Network layer: two key functionsوظيفتا طبقة الشبكة
    2. 3Connection setup and service modelsإنشاء الاتصال ونماذج الخدمة
  2. Virtual circuit and datagram networksشبكات الدارة الافتراضية وشبكات الداتاجرام

    1. 4Datagram vs virtual-circuit networksالداتاجرام والدارات الافتراضية
    1. 5Router architecture overviewمعمارية الموجّه
  3. The Internet network layer and the IP datagram formatطبقة الشبكة في الإنترنت وصيغة داتاجرام IP

    1. 6IP datagram formatصيغة داتاجرام IP
  4. IP fragmentation and reassemblyتجزئة IP وإعادة التجميع

    1. 7IP fragmentation and reassemblyالتجزئة
    2. 8Fragmentation example: 4000 bytes, MTU 1500مثال التجزئة
  5. IP addressing, subnets and CIDRعنونة IP والشبكات الفرعية وCIDR

    1. 9IP addresses and interfacesالعناوين والواجهات
    2. 10Subnets and CIDRالشبكات الفرعية وCIDR
  6. DHCP: Dynamic Host Configuration Protocolبروتوكول DHCP

    1. 11DHCPDHCP
    2. 12DHCP: more than IP addressesما يقدمه DHCP أيضًا
  7. Getting address blocks: hierarchical addressing and ICANNكتل العناوين والعنونة الهرمية وICANN

    1. 13Hierarchical addressing and ICANNالعنونة الهرمية
  8. NAT: network address translationترجمة عناوين الشبكة NAT

    1. 14NAT: network address translationNAT
    2. 15NAT example; why NAT is controversialمثال NAT وجدله
  9. ICMP and tracerouteICMP وtraceroute

    1. 16ICMPICMP
    2. 17Traceroute and ICMPtraceroute
  10. IPv6 and the transition from IPv4IPv6 والانتقال من IPv4

    1. 18IPv6IPv6
    2. 19Transition from IPv4 to IPv6: tunnelingالانتقال والنفق
  11. Routing algorithms: graph abstraction and classificationخوارزميات التوجيه: الرسم البياني والتصنيف

    1. 20Graph abstraction and routing classificationالرسم البياني والتصنيف
  12. Link-state routing: Dijkstra's algorithmتوجيه حالة الرابط: خوارزمية ديكسترا

    1. 21Dijkstra's algorithmخوارزمية ديكسترا
    2. 22Dijkstra's algorithm: worked exampleمثال ديكسترا
  13. Distance vector routing; LS vs DVتوجيه متجه المسافة ومقارنته بحالة الرابط

    1. 23Distance vector: Bellman-Fordمتجه المسافة
    2. 24Distance vector: the x, y, z exampleمثال متجه المسافة
    3. 25Comparison of LS and DV algorithmsمقارنة LS وDV
  14. Hierarchical routing and autonomous systemsالتوجيه الهرمي والأنظمة المستقلة

    1. 26Hierarchical routing: autonomous systemsالأنظمة المستقلة
    2. 27Inter-AS tasks and hot potato routingالمهام بين الأنظمة
  15. Intra-AS routing: RIPالتوجيه داخل النظام: RIP

    1. 28RIP (Routing Information Protocol)RIP
    2. 29RIP example: processing an advertisementمثال RIP
  16. OSPF (Open Shortest Path First)بروتوكول OSPF

    1. 30OSPFOSPF
  17. BGP and why intra- and inter-AS routing differBGP ولماذا يختلف التوجيه الداخلي عن الخارجي

    1. 31BGP; why intra- and inter-AS routing differBGP
    1. 32الخلاصة