- Learn
- Computer Science & IT
- Computer Science
- Computer Networks
- Routing and the Control Plane
Routing and the Control Plane
IntermediateLesson 6 of 8 in Computer Networks Course
What you will learn
- Explain what the control plane of the network layer does, model a network as a weighted graph, and compute least-cost routes with the two classic families of routing algorithms.
- Explain the control plane and model a network as a graphSeparate routing from forwarding, compare per-router control with logically centralized control, and describe routing as a search for least-cost paths in a weighted graph.
- Compute least-cost paths with the link-state algorithmExplain how link-state information is spread, run Dijkstra's algorithm step by step from one router, and turn the result into a forwarding table.
- Compute routes with the distance-vector algorithmApply the Bellman–Ford equation, follow how neighbors exchange distance vectors until the routes settle, and build a forwarding table from the result.
- Handle link changes and compare the two approachesTrace how distance-vector routing reacts when a link becomes cheaper or more expensive, explain count-to-infinity and poisoned reverse, and compare link-state with distance-vector routing.
- Explain the control plane and model a network as a graph
- Explain why Internet routing is organized into autonomous systems and how OSPF builds forwarding tables inside one of them, including large networks divided into areas.
- Organize Internet routing into autonomous systemsExplain why routing is split into routing inside a network and routing between networks, and describe the roles of autonomous systems, gateway routers and the two kinds of routing protocol.
- Explain how OSPF builds forwarding tablesDescribe how OSPF routers discover neighbors, flood link-state advertisements, compute shortest paths and react to a failed link.
- Scale OSPF with areasExplain how dividing a large network into OSPF areas limits flooding and computation, and describe the roles of the backbone, area border routers and AS boundary routers.
- Organize Internet routing into autonomous systems
- Explain how BGP spreads reachability between autonomous systems, how routers choose among the routes they learn, and how business policy and security shape routing between networks.
- Advertise routes between autonomous systems with BGPDescribe BGP sessions, how a prefix advertisement travels from AS to AS, and the role of the AS-PATH and NEXT-HOP attributes and BGP's messages.
- Choose among BGP routes and install themApply BGP's route-selection rules, including hot-potato routing, and explain how a router combines BGP and its intra-AS protocol to build a forwarding-table entry.
- Apply routing policy between providers, customers and peersExplain how business relationships between networks decide which routes an AS accepts, prefers and advertises, and why policy matters more between networks than inside one.
- Recognize BGP failures and how networks defend against themExplain prefix hijacks and route leaks, and how filtering and route origin validation with RPKI limit them.
- Advertise routes between autonomous systems with BGP
- Describe the architecture of a software-defined network and follow the messages through which a controller learns about the network and installs flow-table entries in switches.
- Describe the SDN control-plane architectureExplain the defining features of software-defined networking, the layers of an SDN controller and its northbound and southbound interfaces, and where SDN is used.
- Follow OpenFlow messages between the controller and switchesName the main OpenFlow messages, describe a flow-table entry, and trace how a controller reacts to a link failure by recomputing routes and updating switches.
- Describe the SDN control-plane architecture
- Interpret the messages of the Internet Control Message Protocol and use ping and traceroute to test reachability and discover the routers along a path.
- Interpret ICMP messagesDescribe the purpose and format of ICMP, the most important message types and codes in IPv4 and IPv6, and the rules for when ICMP errors are sent.
- Test reachability with ping and tracerouteExplain how ping and traceroute use ICMP, read a traceroute output, and avoid common misreadings of its results.
- Interpret ICMP messages
- Describe the parts of a network management system and use SNMP for monitoring, and NETCONF with YANG for model-driven configuration of many devices.
- Monitor devices with SNMP and MIBsDescribe the network management framework, explain how SNMP reads and changes MIB objects, and compute link utilization from polled counters.
- Configure networks with NETCONF and YANGExplain how NETCONF applies configuration changes as transactions, how YANG models describe device data, and how this approach compares with SNMP.
- Monitor devices with SNMP and MIBs
Routing and the Control Plane study guide
1Compute routes with link-state and distance-vector algorithms
Routing turns a collection of links into usable end-to-end paths. A router needs a way to learn about the network, choose a path, and turn that choice into a local forwarding entry. Link-state and distance-vector routing solve this problem with different information. Work through their calculations, then follow what happens when a link changes and the routers temporarily disagree.
1.1 From a network path to a next hop
A router makes a local decision for every arriving datagram: which output link should carry it next? The data plane performs that lookup using the forwarding table. The control plane determines the table’s contents, using information about destinations and the network beyond the router.
Two ways to organize control
With per-router control, each router runs routing software and exchanges messages with other routers. OSPF and BGP use this arrangement. With logically centralized control, network-control software obtains a network-wide view and uses a controller to install forwarding rules in devices. This is the SDN approach. “Logically centralized” describes the control service seen by its users; the service can run on several physical servers.
Forwarding is a fast local operation, often implemented in hardware. Routing responds on a slower timescale to changes in connectivity, costs, and policy. A datagram does not wait for a new end-to-end route calculation at every hop. It follows the entries already installed.
Represent the network as a weighted graph
In a graph , nodes are routers and edges are links. A directly connected pair has link cost . A missing direct link has cost . For the worked graphs, costs are symmetric: . The operator chooses what cost represents: link speed, delay, money, or another useful measure.
Add the costs along a path. If A–B costs 3 and A–C and C–B each cost 1, the direct path costs 3 while A–C–B costs 2. A sends traffic for B to C. Counting links would give the wrong decision here; hop count equals path cost only when every link has cost 1.
Classify the algorithm by its information
| Property | Link-state routing | Distance-vector routing |
|---|---|---|
| Starting information | Complete topology and link costs | Attached-link costs and neighbors’ estimates |
| Computation | Each source computes paths on the graph | Each router repeatedly compares routes through neighbors |
| Information exchange | Link descriptions are flooded | Estimated destination costs go to neighbors |
A global algorithm uses complete topology information. This does not require a single computer: OSPF runs a global link-state algorithm independently in each router. A decentralized algorithm builds its answer through local exchanges, as distance-vector routing does.
Other classifications describe when routes change. Static routes change slowly, often through manual edits. Dynamic protocols react to network changes. Load-sensitive costs follow current congestion; load-insensitive costs do not. OSPF and BGP are dynamic protocols whose ordinary route metrics do not track moment-to-moment load.
Connect routing to forwarding
An algorithm is the computation; a protocol supplies message formats, timers, and exchange rules. Dijkstra’s algorithm is a computation. OSPF is a protocol that supplies its input.
The final forwarding entry maps a destination prefix to an outgoing link. Each router chooses its own next hop, so the complete path emerges from the routers’ tables. During convergence, inconsistent tables can create loops; TTL eventually removes a looping IPv4 datagram. Between organizations, a good route must also satisfy policy: an operator can reject a low-cost path because it would carry traffic the operator has not agreed to carry.
Key Takeaways
- The control plane builds forwarding state; the data plane applies it to arriving packets.
- Path cost is the sum of link costs, which need not represent hop count.
- “Global” describes an algorithm’s knowledge, not its physical location.
- Consistent next-hop decisions create the end-to-end path.
- Inter-AS policy can outweigh path cost.
1.2 Build a shortest-path tree with Dijkstra’s algorithm
In link-state routing, each router describes its attached links and floods that description through the network. Once the databases agree, every router has the same graph. Each router runs Dijkstra’s algorithm with itself as the source, so the shared input produces a different rooted tree at each router.
Keep tentative and final costs separate
For source , is the cheapest cost to found so far, and is its predecessor on that path. The set holds routers whose least costs are final. Start with the source in that set, its direct neighbors at their link costs, and all other routers at infinity.
At each iteration, choose the smallest tentative cost outside and add that router, , to the set. For each neighbor still outside, compare the existing estimate with a route through :
If the second route is cheaper, record as the predecessor. Nonnegative link costs make this finalization safe. A value that has merely been updated is still tentative until its router joins .
Work from router A
Use these links: A–B 3, A–C 1, B–C 1, B–D 4, C–D 6, C–E 2, D–E 1, D–F 3, and E–F 5. Initially B has cost 3, C has cost 1, and D, E, and F have infinite cost.
| Router added | Updates to routers still outside the set |
|---|---|
| C, cost 1 | B becomes 2 via C; D becomes 7 via C; E becomes 3 via C |
| B, cost 2 | D becomes 6 via B |
| E, cost 3 | D becomes 4 via E; F becomes 8 via E |
| D, cost 4 | F becomes 7 via D |
| F, cost 7 | No routers remain |
For example, adding E changes D because is below 6. D was updated twice before it became final. Taking its first estimate of 7 as the answer would miss both improvements.
Recover paths and first hops
Follow predecessors backward: F ← D ← E ← C ← A. Reverse that sequence to obtain A–C–E–D–F. Its cost is . The final costs from A are B 2, C 1, D 4, E 3, and F 7.
A forwarding table stores the first hop, not the predecessor of the destination. Every path in this example starts A–C, so A’s next hop is C for all five destinations. The predecessor of F is D, but D is not A’s next hop.
Equal costs, work, and changing load
If two candidates tie for smallest cost, either can be finalized first. The least costs stay the same, although a single chosen path can differ. OSPF can preserve multiple equal-cost paths for load sharing.
The simple algorithm scans candidates at each of its iterations, giving running time; a priority queue can improve this. Link-state flooding also consumes messages because changed link information must reach every router in its flooding scope.
Load-sensitive costs can create feedback. All routers see a lightly loaded path, move traffic to it, and make it expensive; the next calculation moves traffic back. Load-insensitive costs avoid this particular feedback. Randomizing calculation times can also reduce synchronized switching; routers that start at different times can otherwise drift into step.
Key Takeaways
- Finalize the smallest tentative cost, then update its unsettled neighbors.
- A tentative cost can decrease several times before it becomes final.
- Follow predecessors backward to recover a path, then take its first hop.
- Equal-cost ties can change chosen paths without changing least costs.
- The simple implementation takes quadratic time.
- Synchronized reactions to load-sensitive costs can make routes oscillate.
1.3 Learn routes from neighbors’ distance vectors
A router can learn useful paths without learning the entire graph. In distance-vector routing, it knows its attached-link costs and the latest cost estimates received from each neighbor. It uses those estimates to build its own distance vector, a list of estimated costs to all destinations.
Add the first link to the neighbor’s estimate
For a destination , the Bellman–Ford equation is
Try every neighbor . Add the cost of reaching that neighbor to the neighbor’s cost to the destination, then choose the smallest total. The minimizing neighbor becomes the next hop. The cost from a router to itself stays 0; it is not replaced by a route through a neighbor.
During the exchange, routers use estimates in place of the final distances . These estimates can change as information travels farther through the network.
Start, receive, recompute, advertise
At startup, a router records 0 to itself, direct-link costs to neighbors, and infinity to other destinations. It sends that vector to its neighbors. A new vector from a neighbor or a change to a local link triggers recomputation. If the router’s own vector changes, it advertises the new vector; otherwise it has no changed estimate to pass on.
The process is distributed, iterative, and asynchronous. Routers need not update in matching rounds. Information can still reach distant routers because each neighbor’s revised estimate becomes input to another calculation.
Compute a three-router example
Links A–B 4, B–C 1, and A–C 7 give these starting vectors, ordered by destination A, B, C:
| Router | Starting distance vector |
|---|---|
| A | (0, 4, 7) |
| B | (4, 0, 1) |
| C | (7, 1, 0) |
After hearing B, A compares its two routes to C:
It chooses B as next hop. C makes the matching calculation for A and obtains 5 through B. Another exchange leaves the vectors unchanged. With fixed link costs and correct operation, the routers have converged.
A’s forwarding entries are “B → B, cost 4” and “C → B, cost 5.” A knows that B advertises a cost of 1 to C. It does not need B’s complete path or a drawing of the links beyond B.
How RIP supplies the protocol
The Routing Information Protocol (RIP) implements distance-vector routing with hop count. Each link costs 1, the largest usable path is 15 hops, and 16 means unreachable. RIP sends periodic updates every 30 seconds over UDP port 520. A route that has not been refreshed for 180 seconds expires.
Periodic messages belong to the protocol; the underlying algorithm’s changed-vector rule describes when there is new information to propagate. RIP also uses triggered updates to send changes sooner. Confusing these levels can lead to the claim that a stable RIP router sends no messages at all.
Distance-vector estimates are not calculated once and then frozen. A neighbor’s new claim can change the preferred next hop even when every local link stays unchanged. Conversely, receiving a message need not change the router’s own vector if none of the new totals improves or replaces its selected routes.
Key Takeaways
- Compare each first-link cost plus the neighbor’s destination estimate.
- A router’s cost to itself remains 0.
- A distance vector records destination costs without revealing the full topology.
- Changed inputs trigger repeated calculations until estimates settle.
- RIP adds periodic messaging and a maximum usable distance of 15 hops.
1.4 Follow a cost change and break a two-router loop
A distance-vector update can describe a path that depends on the router receiving it. Without that dependency being visible, two routers can each believe the other has a usable route. This is why an increase in link cost can be harder to spread than a decrease.
A cheaper link spreads quickly
Let A–B cost 2, B–C cost 1, and A–C cost 20. B reaches A directly at cost 2; C reaches A through B at cost 3. If A–B falls to 1, B advertises 1 and C changes its cost to 2. When C advertises 2 back, B keeps its direct route. The improvement settles after these two changed updates.
An expensive link exposes stale information
Now start again from costs 2, 1, and 20, and raise A–B to 40. B still has C’s earlier advertisement of 3 to A. It chooses C because is below 40. C still sends to B. Datagrams for A now bounce between B and C until their TTL expires.
C hears B’s cost 4 and computes 5. B hears 5 and computes 6. The estimates keep rising even though neither is describing an independent path to A. This is count-to-infinity: bad news advances through a chain of misleadingly small estimates.
Here an alternative eventually breaks the loop. When B advertises 20, C compares its direct cost 20 with 21 through B and selects its direct link. B then settles at 21 through C. Without a usable alternative or a finite infinity value, the counting can continue much longer.
Advertise the dependency with poisoned reverse
With poisoned reverse, a router tells the neighbor it uses for a destination that its distance to that destination is infinite. Initially C uses B to reach A, so C advertises infinity to B. B can no longer mistake C for an independent alternative.
After the cost increase, B therefore chooses its direct cost 40. C hears 40 and selects its direct link at cost 20. C can now advertise 20 to B, and B chooses cost 21 through C. The advertised value depends on the recipient: C can report its real cost to other neighbors while poisoning the route toward B when B is its next hop.
Split horizon omits such a route from the update instead of advertising infinity. Poisoned reverse prevents this two-router dependency loop, but longer loops can still occur. Triggered updates speed the spread of changes. RIP also defines infinity as 16, limiting both counting time and usable network size.
Compare the two routing families
| Feature | Link-state | Distance-vector |
|---|---|---|
| Messages | Link descriptions flooded throughout the scope | Destination estimates exchanged with neighbors |
| Convergence | Local shortest-path calculation after database updates | Repeated exchanges; bad news can travel slowly |
| Faulty information | A router can misstate its attached links | A router can falsely claim low cost to many destinations |
A full link-state dissemination round has message work on the order of for routers and links. The simple local calculation is quadratic. Distance-vector message work depends on how many successive estimates change; neighbor-only communication does not guarantee quick convergence.
OSPF and IS-IS use link-state routing. RIP uses distance vectors. BGP is a related path-vector protocol: its advertised AS sequence exposes dependencies and lets routers reject paths containing their own AS number.
Key Takeaways
- A stale neighbor estimate can hide a route that returns through the receiving router.
- Count-to-infinity is repeated growth of mutually dependent estimates.
- Poisoned reverse advertises infinity toward the next hop for that destination.
- Poisoned reverse blocks two-router loops; longer loops remain possible.
- Link-state spreads topology; distance-vector spreads destination estimates.
- A false distance-vector claim can propagate well beyond the faulty router.
2Route inside an autonomous system with OSPF
An operator can choose how routing works inside its own network, but it must also exchange traffic with other operators. Autonomous systems provide that boundary. Inside one system, OSPF spreads link information and computes least-cost paths. Its neighbor relationships and areas make that process manageable as a network grows, while gateway routers connect the internal paths to destinations elsewhere.
2.1 Divide routing into networks with their own policies
The Internet is too large and too independently managed to treat every router as a node in one flat routing system. Each organization needs control of its own internal network while still offering usable routes to other organizations. Autonomous systems provide that division.
Identify the administrative boundary
An autonomous system, or AS, is a group of routers under one administration that presents a coherent routing policy to the outside. Public AS numbers, or ASNs, identify these systems globally. Regional Internet registries distribute AS number resources. The original number space was 16 bits, up to 65,535; modern ASNs use 32 bits.
An AS is a routing domain, while an ISP is a business. A university or content provider can operate an AS, and one ISP can operate several. Treating those terms as interchangeable hides the actual policy boundaries.
Use different protocols for different jobs
| Routing task | Main question | Typical protocols |
|---|---|---|
| Intra-AS routing | How do I reach a destination inside our network? | OSPF, IS-IS, RIP, EIGRP |
| Inter-AS routing | Which neighboring network offers an acceptable route? | BGP |
An interior gateway protocol (IGP) supplies internal routes. Within a routing domain, routers use a common IGP so they can exchange the information it needs. Different ASes can choose different IGPs. A provider using IS-IS can connect to a university using OSPF because their external routing exchange uses BGP.
The hierarchy serves two needs. It reduces the amount of worldwide detail that internal routers must process, and it preserves administrative autonomy. A local link change does not need to expose the complete internal topology to every other AS.
Combine an exit choice with an internal path
A gateway router connects to another AS. For an external destination, BGP identifies a usable route and its next-hop gateway address. The internal protocol supplies the path toward that address. These decisions combine to produce the forwarding entry used for an arriving packet.
Suppose router R learns that 198.51.100.0/24 is reachable through gateway G. OSPF says the path from R to G begins through neighbor H. R’s forwarding entry for the external prefix uses the link to H. G is the exit from the AS, while H is R’s immediate next hop; those roles need not belong to the same router.
Recognize when one exit is enough
A small customer with one external connection has no choice of exit. A default IPv4 route, 0.0.0.0/0, can send external traffic toward that connection. Learning every Internet route would not create an alternative exit.
With several gateways, reachability information matters: one gateway may offer a prefix that another does not, or policy may favor one provider. BGP distributes the route choices; the IGP still carries packets to the chosen exit.
Inside one AS, one operator can choose link costs to meet internal performance goals. Across ASes, cost competes with agreements about paid transit, peers, and which traffic an operator will carry. This is why choosing an Internet route involves more than extending a shortest-path calculation across the next administrative boundary.
Key Takeaways
- An AS is a routing domain with one external policy, not necessarily an ISP.
- An IGP finds internal paths; BGP exchanges routes across AS boundaries.
- An external forwarding entry combines a BGP route with an internal path to its next hop.
- A single-exit customer can use a default route.
2.2 How OSPF turns link information into routes
Open Shortest Path First (OSPF) is a link-state IGP. Each router learns the topology within its area, runs Dijkstra’s algorithm from itself, and derives routes to subnets. OSPFv2 serves IPv4; OSPFv3 was designed for IPv6.
Choose costs and discover neighbors
The operator sets link weights. All weights equal to 1 produce minimum-hop routes. An illustrative inverse-speed rule with a 10 Gbit/s reference is
It gives weights 1, 10, and 100 for 10 Gbit/s, 1 Gbit/s, and 100 Mbit/s links. Weight is a configured routing measure, not a distance in kilometers.
Hello packets discover and maintain neighbors. A common LAN setting sends Hellos every 10 seconds and uses a 40-second dead interval. Missing a single Hello is therefore different from declaring the neighbor dead. Neighboring routers synchronize databases using Database Description packets, Link State Requests, Link State Updates, and Link State Acknowledgments. Routers with synchronized databases form an adjacency.
Flood fresh link descriptions
A link-state advertisement (LSA) describes routing information. A router-LSA records a router’s links and costs. LSAs travel in Link State Update packets; an LSA is the advertised information, not the name of every OSPF packet.
Changed links trigger fresh advertisements. Routers also refresh their own LSAs at least every 30 minutes. An LSA at the maximum age of one hour is removed. Sequence information and age let routers distinguish fresh descriptions from old ones.
OSPF is carried directly in IP using protocol number 89. It supplies acknowledgments and retransmissions itself. On broadcast networks, 224.0.0.5 reaches all OSPF routers and 224.0.0.6 reaches the designated routers.
Reduce LAN adjacencies
A LAN elects a designated router (DR) and a backup designated router (BDR). Other routers form full adjacencies with those two, instead of every pair becoming adjacent. The DR advertises the shared LAN in a network-LSA.
For six routers, a full mesh would need adjacencies. Four ordinary routers each connect logically to the DR and BDR, plus one DR–BDR adjacency: . Neighbors can hear one another without all becoming fully adjacent.
Recalculate after a failed link
Consider links A–B 3, A–C 1, B–C 1, B–D 4, C–D 6, C–E 2, D–E 1, D–F 3, and E–F 5. A initially reaches E at cost 3, D at 4, and F at 7 through C and E.
When C–E fails, C and E flood new router-LSAs that remove the link. Recalculation gives A costs B 2, D 6, E 7, and F 9. The paths to D and F now use C–B–D. A’s first hop still stays C: a changed complete path does not require a changed first forwarding hop.
OSPF supports authenticated routing messages and equal-cost multipath (ECMP). Cryptographic authentication is stronger than a plain-text password; it checks authorized message origin and integrity. ECMP lets a router retain multiple equal-cost paths. These features operate on link-state information, not on exchanged tables of estimated destination distances.
Key Takeaways
- OSPF floods LSAs and each router computes its own routes.
- Configured weights determine least-cost paths.
- Hellos maintain neighbors; database synchronization establishes adjacencies.
- OSPF uses IP protocol 89 and supplies its own reliable flooding.
- A DR and BDR reduce full adjacencies on a broadcast LAN.
- After a failure, the path and cost can change while the first hop stays the same.
- OSPF can authenticate messages and retain equal-cost paths.
2.3 Keep detailed topology inside OSPF areas
A router in a large AS need not process every internal link as part of one detailed graph. OSPF areas divide the link-state database and shortest-path work. Routers retain local detail and learn routes describing destinations beyond their own area.
Connect areas through the backbone
The backbone is area 0, also written 0.0.0.0. Other areas attach to it. Traffic between two non-backbone areas travels to the backbone and then into the destination area.
An area border router (ABR) connects areas, including the backbone. It keeps a separate database for each attached area and advertises routes between them. Information about a remote subnet can cross the boundary without exposing all the remote area’s routers and links. Summarization can also combine suitable prefixes; it does not require every remote subnet to disappear into one aggregate.
An AS boundary router (ASBR) introduces routes from outside OSPF’s domain, such as routes learned from another AS. An ABR crosses an area boundary; an ASBR introduces external routing information. One device can hold both roles.
Match advertisements to their purpose
| LSA type | Information | Originating role |
|---|---|---|
| 1, router-LSA | A router’s links within an area | Each router |
| 2, network-LSA | A shared broadcast network | The DR |
| 3, summary-LSA | A subnet reachable in another area | An ABR |
| 4, summary-LSA | How to reach an ASBR | An ABR |
| 5, AS-external-LSA | A destination from outside the OSPF domain | An ASBR |
Types 1 and 2 describe the detailed area graph. Types 3 and 4 carry inter-area reachability information. Type 5 normally spreads through the AS, with special area types restricting external advertisements.
Trace an inter-area packet
A host’s packet starts in area 7 and is destined for area 9. It first follows routes inside area 7 to an ABR, crosses area 0 to an ABR attached to area 9, and then follows routes inside area 9. This is a hierarchy inside one AS; crossing an area boundary does not turn the packet into inter-AS traffic.
An internal router has all interfaces in one area. A backbone router has at least one interface in area 0. An ABR is also a backbone router, so the role names are not mutually exclusive.
Understand what a local failure changes elsewhere
Dividing roughly 400 routers into four areas of about 100 can greatly reduce each router’s detailed graph, while adding inter-area routes. The exact database size also depends on border routers and advertised networks.
If a link repeatedly fails inside one area, its detailed LSAs and full shortest-path recomputation stay in that area. If the change also alters a destination’s advertised cost or reachability, the ABR sends changed summaries. Routers elsewhere update the affected inter-area routes. Areas therefore limit the detail and computation that spread; they do not hide every effect of a failure.
Less detail has a cost. An inter-area route follows the area hierarchy and may differ from the globally least-cost route through a flat graph of the entire AS. The operator gains smaller databases and more contained changes while giving up some freedom in path choice.
Key Takeaways
- Area 0 carries traffic between non-backbone areas.
- ABRs exchange inter-area reachability; ASBRs introduce external routes.
- Router and network LSAs describe an area’s detailed graph.
- Areas contain detailed flooding, while changed summaries can affect other areas.
- An OSPF area is a subdivision of an AS.
3Route between networks with BGP
A route across the Internet crosses networks with different owners and priorities. BGP spreads promises of reachability and lets each operator decide which promises to accept and pass on. Follow an advertisement, compare competing routes in order, and connect the winning route to a forwarding interface. Business relationships explain many choices; filtering and origin validation help contain mistakes and attacks.
3.1 Follow a BGP advertisement across autonomous systems
BGP-4 exchanges reachability for destination prefixes. An advertisement says that the announcing network offers a route toward that prefix. Other networks can accept it, rank it against alternatives, or refuse it according to policy.
Establish a session
BGP speakers exchange messages over a long-lived TCP connection using port 179. eBGP joins speakers in different ASes; iBGP joins speakers in the same AS. Internal sessions distribute external reachability within the AS, and need not correspond to direct physical links.
The basic iBGP design uses a full mesh between BGP speakers. Larger networks can use route reflectors to reduce the number of sessions. iBGP does not replace the IGP: the IGP still supplies internal paths needed to reach BGP next hops.
Add the AS number as a route travels outward
AS 64503 originates 203.0.113.0/24. Its advertisement to AS 64502 has AS-PATH “64503.” AS 64502 distributes the route internally over iBGP, then advertises it to AS 64501 with AS-PATH “64502 64503.” External propagation prepends the advertising AS’s number; ordinary internal distribution does not add another copy of that number.
A BGP route pairs the prefix with attributes. AS-PATH records the sequence of ASes, most recent first. NEXT-HOP identifies the router address toward which traffic should be sent, normally an interface at the neighboring gateway. An internal speaker uses the IGP to resolve a path to that address.
Reject an AS-level loop
A speaker rejects a route whose AS-PATH contains its own AS number. If AS 64501 receives “64502 64501 64503,” accepting it would send traffic along an AS sequence that returns to 64501. Carrying this dependency makes BGP a path-vector protocol and avoids the plain distance-vector count-to-infinity problem.
An AS path is not a list of every router on the packet path. Two AS hops can include many physical links, and policies can select a longer AS path. Its length alone says little about measured delay.
Interpret the basic messages
| Message | Job |
|---|---|
| OPEN | Start a session and exchange settings, including hold time |
| UPDATE | Announce reachability or withdraw previously announced routes |
| KEEPALIVE | Maintain a quiet session |
| NOTIFICATION | Report an error and close the session |
The standard suggests a hold time of 90 seconds and keepalives every 30 seconds. Negotiated settings can differ. A speaker withdraws routes learned over a session when that session fails; keeping a TCP connection open is different from proving that every advertised destination works.
After the initial exchange, BGP sends incremental changes instead of periodically sending the complete table. Rate limiting can reduce repeated announcements for one prefix; the standard suggests 30 seconds between such eBGP advertisements.
TCP provides ordered delivery between the two speakers. BGP’s own attributes, policy rules, and update processing determine which routes are retained and propagated. Reliable transport by itself supplies no proof that a neighbor is entitled to originate the advertised prefix.
Key Takeaways
- BGP advertises prefixes and attributes over TCP port 179.
- eBGP crosses AS boundaries; iBGP spreads routes inside an AS.
- An external advertisement prepends the advertising AS number.
- A speaker rejects an AS-PATH containing its own AS number.
- Updates carry changes after the initial table exchange.
3.2 Choose a BGP route before finding its output interface
Several gateways may offer a route to the same prefix. A BGP speaker first applies import policy, then compares accepted, usable routes in a defined order. It stops at the first decisive difference; a later advantage cannot undo an earlier preference.
Compare attributes in order
- Prefer the highest LOCAL_PREF, set by the local operator.
- Prefer the shortest AS-PATH.
- Prefer the lowest ORIGIN value: IGP, then EGP, then INCOMPLETE.
- Prefer the lowest MED among routes from the same neighboring AS.
- Prefer an eBGP-learned route over an iBGP-learned route.
- Prefer the lowest IGP cost to the NEXT-HOP.
- Prefer the lowest advertising BGP identifier when earlier comparisons tie.
Router implementations can add steps such as vendor-specific local weight. LOCAL_PREF is distributed inside the AS and stays there. MED lets a neighboring AS suggest a preferred entry point; MED values from unrelated neighboring ASes are not compared by the ordinary rule.
Compare two exits
R in AS 64501 learns two routes over iBGP to 203.0.113.0/24. G1 offers AS-PATH “64502 64503” at IGP cost 3; G2 offers “64504 64503” at IGP cost 5. Both have LOCAL_PREF 100 and equal ORIGIN. The paths each contain two ASes. MED does not choose between these different neighboring ASes, and both routes are internal advertisements.
The IGP cost therefore decides: R chooses G1 because . This is hot-potato routing: send traffic out through the least costly internal exit among otherwise equal routes.
If routes through AS 64504 receive LOCAL_PREF 200, G2 wins immediately. Its higher internal cost no longer matters. With equal LOCAL_PREF, a path containing only “64503” would beat both two-AS paths before hot-potato routing was considered.
Resolve the winning next hop
BGP has chosen a route through G1, but R may have no direct link to G1. OSPF supplies the least-cost internal path to that next-hop address. If the path starts on interface I, the forwarding entry becomes “203.0.113.0/24 → I.” The decision needs both protocols: BGP selects external reachability, and the IGP resolves internal delivery toward it.
Different internal routers can have different costs to G1 and G2, so otherwise equal BGP choices can lead them to use different exits. Independent policies at the other end can also make the reverse packet path different from the forward path. Internet routing is often asymmetric.
Apply the same selection to anycast
With IP anycast, multiple service locations advertise the same prefix. Routers choose among the advertisements through ordinary BGP selection. A client reaches the instance preferred by routing policy, AS path, and internal costs, which need not be the geographically closest instance.
This works well for short exchanges such as DNS queries. A routing change during a long TCP connection can send later packets to another instance that lacks the connection’s state.
Key Takeaways
- BGP stops at the first decisive comparison.
- LOCAL_PREF outranks AS-PATH length.
- MED normally compares entry points offered by the same neighboring AS.
- Hot-potato routing uses internal cost only after earlier preferences tie.
- The IGP resolves a selected BGP next hop into an outgoing interface.
- Anycast proximity is determined by routing, not geography.
3.3 Use business relationships to control transit
Advertising a route is an invitation to send traffic toward it. An operator’s export policy therefore determines which traffic the network offers to carry. Customer, provider, and peer relationships explain the usual rules.
Distinguish transit from peering
A customer pays a provider for transit to and from the rest of the Internet. Two peers exchange traffic for themselves and their customers, often without settlement payments. Networks often establish peering at an Internet exchange point (IXP).
Peering usually does not provide a route to everything the peer can reach through its own providers. That wider service is transit. A peer relationship describes an agreement about traffic, not simply a physical cable between routers.
Separate import and export decisions
Import policy chooses which received advertisements to accept and what preference to assign them. Export policy chooses which routes to advertise to each neighbor. A route can be accepted and used locally without being offered to every other neighbor.
Usual import preferences favor customer routes, then peer routes, then provider routes. LOCAL_PREF can encode that order. Customer traffic earns revenue, peer traffic usually avoids transit charges, and provider traffic incurs transit cost. This preference can outweigh AS-PATH length.
Apply the usual export rules
| Route learned from | Advertise to customers | Advertise to peers | Advertise to providers |
|---|---|---|---|
| Customer | Yes | Yes | Yes |
| Peer | Yes | No | No |
| Provider | Yes | No | No |
An AS also advertises its own destinations according to its agreements. The table describes the common commercial pattern; operators implement policy through explicit filters and preferences.
Advertising a customer route widely attracts traffic toward the paying customer. Restricting peer- and provider-learned routes to customers avoids offering unpaid transit between outside networks. The relevant direction is where the route was learned and to whom it will be advertised, not which direction one packet happens to travel.
Follow a multihomed customer
Customer X, AS 64510, has providers B and C. X announces its own prefix to both for reachability and resilience. It accepts routes from both, but keeps a route learned from B out of advertisements to C. It also keeps C’s routes out of advertisements to B. Otherwise one provider could send traffic through X to destinations behind the other provider.
For a peer example, A and B are peers and W is A’s customer. B can use the route “A W” and export it to B’s customers. B withholds that peer-learned route from another peer C. Exporting it to C would offer transit between peers through B.
Inside one AS, a single operator can optimize internal costs. Between ASes, independent operators control price, traffic obligations, and acceptable counterparties. A missing advertisement can be an intentional refusal to carry traffic, even when a physical path exists.
Key Takeaways
- Import policy filters and ranks received routes; export policy controls advertisements.
- Transit provides wider reachability than ordinary peering.
- Customer-learned routes are usually exported to all neighbor types.
- Peer- and provider-learned routes are usually exported only to customers.
3.4 Limit hijacks and leaks without trusting every announcement
Basic BGP advertisements do not prove prefix ownership or authenticate the complete AS-PATH. An incorrect announcement can spread through many networks unless policy and validation stop it. Two important failures are prefix hijacks and route leaks.
Recognize what goes wrong
A prefix hijack announces an unauthorized prefix or a more specific part of someone else’s prefix. Routers accepting the route can send traffic toward the wrong origin. Once routes for different prefix lengths are installed, forwarding uses longest-prefix matching. A /24 route inside a /22 wins for matching addresses, even if the /22 has a shorter AS-PATH. BGP comparisons between routes to one prefix and forwarding comparisons between different prefixes are separate decisions.
A route leak exports a route beyond its intended policy boundary. For example, a customer passes provider-learned routes to another provider and becomes an unintended transit network. The prefix origin can be legitimate while the propagation is wrong.
Learn from a real incident
On February 24, 2008, Pakistan Telecom, AS 17557, announced 208.65.153.0/24 as part of a domestic YouTube block. Its provider propagated that more specific route internationally. Much of the traffic for those YouTube addresses was drawn toward Pakistan.
The widely visible incident ran from 18:47 to 21:01 UTC, a little over two hours. YouTube announced the /24 itself and then two /25 prefixes while trying to recover traffic. The incident ended when the provider withdrew the false route. A locally intended change had become an international reachability failure because export filtering failed.
Filter before a mistake spreads
A provider can accept only the prefixes a customer is authorized to originate. A maximum-prefix limit can stop a session that suddenly announces far more routes than agreed. Many networks also filter IPv4 prefixes longer than /24 and IPv6 prefixes longer than /48. Such filters limit what advertisements spread; a technically more specific route has an effect only where it is accepted.
Check the authorized origin with RPKI
The Resource Public Key Infrastructure (RPKI) lets address holders publish signed Route Origin Authorizations (ROAs). A ROA names the allowed origin ASN, a prefix, and the maximum allowed prefix length.
Suppose AS 64503 is authorized for 203.0.113.0/24 with maximum length /24:
| Announcement | Origin-validation state | Reason |
|---|---|---|
| 203.0.113.0/24, origin 64503 | Valid | Prefix length and origin are authorized |
| 203.0.113.0/24, origin 64510 | Invalid | Origin is unauthorized |
| 203.0.113.128/25, origin 64503 | Invalid | Prefix is longer than permitted |
| 198.51.100.0/24, no covering ROA | Not found | No covering authorization is available |
If several validated authorizations cover a route, one matching origin and length authorization makes it valid. With covering authorizations but no match, the route is invalid. Networks choose how to act on these states; rejecting invalid routes blocks many unauthorized origins. “Not found” means an authorization is absent, not that a wrong origin has been demonstrated.
Origin validation checks the final origin ASN, not every transit AS or the export relationship. Forging a path that ends with an authorized origin can therefore pass this check, and a leak can retain a valid origin. BGPsec adds path-signing mechanisms, but origin validation, route filters, and monitoring remain distinct defenses.
Key Takeaways
- Longest-prefix matching lets an accepted unauthorized more specific route attract traffic.
- A leak can propagate a legitimate origin beyond its intended policy boundary.
- A ROA authorizes an origin ASN and maximum prefix length.
- Valid, invalid, and not found are distinct origin-validation results.
- Origin validation does not validate the full AS-PATH or export policy.
4Explain how an SDN controller builds forwarding tables
A routing decision can run in software outside the switches that forward the packets. In software-defined networking, applications use a controller’s network view to decide what rules to install. The controller communicates those rules to switches and reports changes back to the applications. Tracing a failed link shows how topology information, path calculation, and flow-table updates fit together.
4.1 Move control decisions into applications and a controller
Software-defined networking (SDN) separates packet forwarding from the software that decides network behavior. Switches apply flow rules, while applications use a controller to read network state and install the rules they need. The arrangement makes control programmable.
Identify the three components
Data-plane switches perform match-plus-action forwarding. A flow can match fields from several layers, including Ethernet addresses, IP addresses, and transport ports. Actions can forward, drop, modify, or send a packet to the controller.
The controller maintains network state and communicates with devices. Network-control applications make decisions, such as computing a route or choosing a load-balancing rule. A routing application can still use Dijkstra’s algorithm. SDN changes the location and interfaces of control, without requiring a new shortest-path method.
The defining features work together: flow-based forwarding, separate control and data planes, control functions outside switches, and software applications that program network behavior.
Follow the controller’s layers
| Controller part | Main job |
|---|---|
| Communication layer | Exchange commands, events, and statistics with devices |
| Network-wide state management | Track links, switches, hosts, and installed flow state |
| Application interface | Let applications read state, request changes, and subscribe to events |
The southbound interface connects the controller to devices. OpenFlow is a well-known example; management protocols such as SNMP and NETCONF can also support device communication. The northbound interface connects applications to the controller, often through a REST API. “North” and “south” describe software roles, not physical positions in a network rack.
Distinguish logical from physical centralization
Applications see a coherent controller service with a network-wide view. That service can run on one server or a replicated cluster. A cluster can share load and continue after one server fails, provided its state sharing and failover work correctly. Logical centralization does not require one physical machine.
A single-server controller is a single point of failure for its control service. Replication reduces that exposure but leaves the controller a critical part of the network. Applications depend on an accurate view of the topology to produce useful rules.
Trace a routing request
Suppose a controller records the available links between four switches. A routing application reads that topology through the northbound API and computes a least-cost path. It asks the controller to install the corresponding forwarding entries. The controller translates the request into southbound messages to the affected switches. Later packets follow those installed entries locally.
Changing a routing application can therefore change network behavior without changing each switch’s built-in routing software. The same forwarding hardware can support routing, access control, or load balancing according to the installed rules.
SDN is used within organizational networks such as data centers and private wide-area networks. Google’s B4 is an example of centralized control for a private network connecting data centers. ONOS and OpenDaylight are examples of open-source controller platforms. At boundaries between independent networks, BGP still exchanges reachability; SDN control inside an AS and BGP between ASes can operate together.
Key Takeaways
- Switches apply flow rules; applications decide which rules the network needs.
- The controller joins device communication, shared state, and application interfaces.
- Northbound interfaces face applications; southbound interfaces face devices.
- One logical controller can run on multiple servers.
- SDN can reuse Dijkstra’s algorithm and coexist with BGP.
4.2 Update switch rules with OpenFlow
OpenFlow carries commands and events between a controller and switches. It uses TCP, with registered port 6653, and can protect the connection with TLS. The controller needs both ways of communicating: it changes forwarding state and receives evidence that the state or topology has changed.
Read a flow entry
A flow entry has match fields, a priority, counters, actions, and timeouts. In a table, the highest-priority matching entry controls the packet’s handling. A broad match can therefore lose to a more specific rule with a higher priority.
In OpenFlow 1.3, a lowest-priority table-miss entry can handle a packet that matches no ordinary entry. Its action can send the packet to the controller. With no table-miss entry, an unmatched packet is dropped by default. A miss alone does not require a packet-in message.
Match messages to their jobs
| Direction | Message or operation | Job |
|---|---|---|
| Controller to switch | Features, configuration | Learn capabilities or read and change configuration |
| Controller to switch | Flow-mod | Add, modify, or delete flow entries |
| Controller to switch | Port-mod | Change a port’s configuration |
| Controller to switch | Read-state requests | Obtain statistics and counters |
| Controller to switch | Packet-out | Send a specified packet through the switch |
| Switch to controller | Port-status | Report a port-state change |
| Switch to controller | Flow-removed | Report removal of a flow entry |
| Switch to controller | Packet-in | Deliver a packet or header because a rule requests it |
Flow-mod and port-mod are both ways to modify switch state, but only flow-mod edits forwarding entries. Packet-out handles a particular packet; it does not by itself install a rule for later packets.
Repair paths after a failure
Take switches S1 through S4. The S1–S2 link fails while another route through S3 and S4 remains available.
- S1 detects its port going down and sends port-status.
- The controller removes the failed link from its network-state view.
- The routing application receives the event through its northbound subscription.
- The application recomputes paths on the revised topology.
- A flow-table computation component turns those paths into switch rules.
- The controller sends flow-mod messages to the switches whose entries must change, such as S1, S3, and S4.
The reporting switch supplies an event; it does not compute a network-wide repair on its own. The application also needs rules installed at the affected switches, not just a new path stored in the controller.
Install before traffic or react to its first packet
With proactive installation, entries are ready before packets arrive. With reactive installation, a configured action sends a new flow’s first packet to the controller in packet-in. The controller can arrange a rule and use packet-out when it needs to release a packet.
Reactive setup adds delay to the first packet and work for the controller. Once the entry exists, subsequent matching packets stay in the data plane. The controller handles selected events and packets, not every packet in every flow. Expiring entries can later generate flow-removed notifications, letting applications track changes to installed state.
Key Takeaways
- A flow table uses the highest-priority matching entry.
- An unmatched packet is dropped when no table-miss entry handles it.
- Port-status reports a change; flow-mod changes flow-table entries.
- A path repair needs updated topology, a new computation, and installed rules.
- Reactive setup involves the controller for selected packets, then normal forwarding stays local.
- Packet-out sends a packet; it does not install a lasting flow entry.
5Report errors and test paths with ICMP
A packet can fail to arrive even when its destination address is correct. ICMP reports some of these failures and supports tests of reachability and paths. Ping measures replies from one target; traceroute uses limited packet lifetimes to reveal responding routers along a route. Reading either test requires care: a missing reply and a slow reply can have several causes, and each RTT includes a return journey.
5.1 Read ICMP reports and preserve path MTU discovery
ICMP carries network-layer reports and tests inside IP datagrams. ICMPv4 uses IPv4 protocol number 1. Its messages have a type, a code, and a checksum. The type gives the broad purpose; the code refines it.
Connect an error to the packet that caused it
An ICMPv4 error includes the original IP header and at least the first 8 bytes of the original payload. That quotation usually supplies the transport information needed to identify the affected flow. The error goes toward the original sender, which can then relate the report to a packet it sent.
| ICMPv4 type | Meaning | Useful code |
|---|---|---|
| 0 | Echo reply | 0 |
| 3 | Destination unreachable | 0 network, 1 host, 2 protocol, 3 port, 4 fragmentation needed |
| 5 | Redirect | Code refines the redirect |
| 8 | Echo request | 0 |
| 11 | Time exceeded | 0 for TTL expired in transit |
| 12 | Parameter problem | Code refines the header problem |
Type 4, source quench, is deprecated and is not a modern congestion-control mechanism.
Work from the failure to its report
A router that reduces TTL to 0 discards the datagram and reports time exceeded. A router with no route can report network unreachable. A destination host receiving UDP for an unused port can report port unreachable. These are different failures: reaching the host does not guarantee reaching a listening application.
ICMP errors are not reliable delivery receipts. Filtering, message loss, or rate limiting can prevent a report from reaching the sender. An unanswered test therefore leaves several possible explanations.
IPv4 suppresses errors about another ICMP error, about broadcast or multicast traffic, and about fragments other than the first. These rules prevent error cascades and excessive replies. Devices also rate-limit error generation.
Distinguish ICMPv6
ICMPv6 uses IPv6 next-header value 58. Its error types are 1 destination unreachable, 2 packet too big, 3 time exceeded, and 4 parameter problem. Echo request and reply are types 128 and 129. Neighbor Discovery also uses ICMPv6 and takes over IPv6’s neighbor-resolution role from ARP.
IPv6 error rules include multicast exceptions: Packet Too Big can be sent in response to a multicast packet, and certain unknown-option errors can be as well. Applying IPv4’s blanket multicast suppression to ICMPv6 would break required behavior.
Follow path MTU discovery
For classic IPv4 path MTU discovery, the sender sets Don’t Fragment. A router that meets a smaller outgoing-link MTU drops an oversized datagram and returns type 3, code 4, reporting the next-link MTU. The sender can reduce the size of later packets.
For example, an IPv4 datagram of 1,500 bytes reaches a link with MTU 1,400 bytes while Don’t Fragment is set. The router drops it and reports fragmentation needed with MTU 1,400. The sender adjusts its IP packet size; the 1,400-byte value includes the IP header, so it is not the maximum application payload.
IPv6 routers never fragment forwarded packets. They return Packet Too Big so the source can adjust. Blocking all ICMP removes this feedback and can create a path MTU black hole: small packets work while larger ones disappear. Selective filtering preserves the messages needed for network operation.
Key Takeaways
- ICMP type and code identify a report’s purpose and detail.
- ICMPv4 errors quote enough of the original packet to help identify the flow.
- TTL expiry, a missing route, and an unused UDP port produce different reports.
- ICMPv6 has its own type values and multicast error exceptions.
- Path MTU discovery depends on fragmentation-needed or Packet Too Big feedback.
- A missing reply can result from filtering or rate limiting as well as failure.
5.2 Use ping and traceroute without overreading their results
Ping asks a target to reply. Traceroute uses probes that expire at successive hops to find responding routers along the forward path. Both report round-trip measurements, which combine outward travel, reply generation, and return travel.
Read a ping result
For IPv4, ping sends echo requests, type 8 code 0, and receives echo replies, type 0. Each successful exchange provides an RTT. If three of four probes receive replies, one of four is unanswered: the observed loss is 25%.
A reply establishes that an exchange with the target worked at that time. No reply can mean a failed target or path, but it can also mean filtered or rate-limited echo messages. Ping tests these messages, not every application protocol that might use the host.
Reveal successive hops with limited TTL
Traceroute first sends a probe with TTL 1. The first router decrements it to 0, discards it, and can return ICMP time exceeded. TTL 2 reaches the next router before expiring. Increasing TTL repeats this process farther along the path. The source records the address and elapsed time for each reply.
Classic Unix traceroute uses UDP probes to unlikely destination ports, starting at 33434. At the destination, port unreachable signals arrival. Windows tracert uses echo requests and recognizes an echo reply at the destination. Three probes at each TTL are common; separate probes can follow different load-balanced paths.
Interpret a complete trace
| Hop | Responding address | RTT |
|---|---|---|
| 1 | 192.168.1.1 | 1 ms |
| 2 | 198.51.100.1 | 9 ms |
| 3 | 198.51.100.77 | 12 ms |
| 4 | 203.0.113.9 | 95 ms |
| 5 | 203.0.113.80, destination | 97 ms |
The destination answers at hop 5. The measured RTT rises by ms from hop 3 to hop 4 and remains high afterward. That is consistent with a slower or longer segment near that point, but the subtraction is not the one-way delay of the intervening link. The replies are different packets, may use different return paths, and include different processing and queuing delays. No link length follows from these RTTs alone.
Explain silence and unusually high middle-hop RTTs
A line reading “* * *” means the probes at that TTL received no timely reply. If later hops answer, packets are getting farther through the network. The silent router may forward normally while suppressing its own ICMP replies.
A middle router can also show a higher RTT than later routers. Creating an ICMP reply can receive lower priority than forwarding traffic, so one slow control-plane response does not establish a slow forwarding link. Persistent increases that continue to later hops deserve different attention from an isolated spike.
Keep the path’s limits in view
Traceroute reveals responding router interfaces, not a list of AS numbers. Mapping those addresses to the networks announcing them is an extra step. The trace also leaves the return path unshown, although that return path contributes to every RTT. Routing policies and hot-potato choices can make the reverse direction follow different networks, so a separate reverse trace can tell a different story.
Key Takeaways
- Ping reports echo exchanges and their RTTs.
- Traceroute increases TTL and identifies routers from expiry reports.
- UDP traceroute usually ends with port unreachable; echo-based tracing ends with echo reply.
- Asterisks record missing timely replies, even when forwarding continues.
- RTT differences are not per-link one-way delays.
- A trace shows responding forward-path interfaces, not the return path or AS boundaries.
6Manage networks with SNMP, NETCONF and YANG
Operators need to see what a network is doing and change how its devices behave. SNMP exposes named objects for monitoring and limited changes; counters turn those observations into rates. NETCONF provides structured configuration operations, and YANG defines the data those operations carry. A coordinated change across two routers shows why checking a configuration and safely activating it are different jobs.
6.1 Turn SNMP objects and counters into monitoring data
Network management connects an operator’s goals to device observations and changes. Its framework has five parts: a managing server, managed devices, the devices’ data, agents that expose that data, and a protocol linking agents to the server.
Identify the objects and messages
SNMP, the Simple Network Management Protocol, usually uses UDP. Agents listen on port 161; managers receive notifications on port 162. GetRequest reads objects, GetNextRequest steps through their naming order, and GetBulkRequest reads many values efficiently. SetRequest changes writable objects. Response carries the result.
A trap is an unsolicited notification without an application-level acknowledgment. An InformRequest is acknowledged by the receiver. An agent can therefore report an event without waiting for the next monitoring poll.
A Management Information Base (MIB) defines managed objects in modules using the SMI data-definition language. Each object has an object identifier (OID) in a worldwide naming tree. The OID identifies a defined object; the agent supplies its current value.
For example, sysUpTime, OID 1.3.6.1.2.1.1.3, measures time since the device’s management system restarted. ifInOctets, OID 1.3.6.1.2.1.2.2.1.10, defines per-interface received-byte counters. A table entry also needs its interface instance to identify which interface’s value is being read.
Calculate utilization from two polls
A 100 Mbit/s interface’s counter rises from 1,250,000,000 to 1,475,000,000 bytes over 60 seconds. First find the amount received:
Convert bytes to bits and divide by elapsed time:
Incoming utilization is , or 30%. A counter is a cumulative total, not a rate; the difference and elapsed time are both needed. Keeping bytes and bits separate prevents an eightfold error.
Recognize wraparound and restart
ifInOctets is 32-bit and wraps after bytes. At 1 Gbit/s, that takes about seconds. A 60-second interval can hide multiple wraps, so the two values alone cannot recover the traffic total. The 64-bit ifHCInOctets is suitable for fast interfaces.
When at most one wrap occurred and no reset occurred, add to a negative difference. A device or counter restart needs separate handling; treating every decrease as a wrap can create a false traffic spike.
Choose secure monitoring and structured changes
SNMPv1 and SNMPv2c use plain-text community strings. SNMPv3 supports authentication, encryption, and object-level access control; select the security settings that provide those protections.
SNMP is widely used for monitoring. One SetRequest validates its requested changes before applying them as a group on one device. If assignment fails, the agent tries to undo the changes; an undoFailed response reports that recovery itself failed. It does not create a transaction across multiple devices. Editing individual MIB objects is also cumbersome for large configurations. A CLI can be typed or scripted, but device-by-device text commands become harder to coordinate at scale; NETCONF offers structured configuration operations instead.
Key Takeaways
- MIB modules define objects; OIDs identify them and agents expose their values.
- Traps are unacknowledged notifications; informs are acknowledged.
- A counter difference divided by elapsed time gives a rate.
- Convert bytes to bits before comparing with a bit/s link speed.
- Multiple hidden wraps make a short counter unsuitable for a polling interval.
- SNMPv3 supports authenticated, encrypted management with access control.
- A SetRequest groups objects on one device, not several devices.
6.2 Prepare and activate configuration with NETCONF and YANG
NETCONF reads and changes structured device configuration. YANG defines the structure, types, and constraints of the data being managed. The protocol moves and applies data; the model describes what that data means and which values are allowed.
Open a secure session and inspect capabilities
NETCONF normally runs over SSH using port 830; secure transport can also use TLS. Client and server exchange hello messages that announce supported capabilities. Requests and replies are XML-encoded remote procedure calls (RPCs).
| Operation | Purpose |
|---|---|
get-config | Read configuration |
get | Read configuration and operational state |
edit-config | Change a configuration datastore |
copy-config, delete-config | Replace or remove a whole configuration where permitted |
lock, unlock | Control concurrent access to a datastore |
validate | Check a configuration when supported |
commit | Activate a prepared candidate configuration when supported |
close-session, kill-session | End a session normally or terminate one |
Capabilities matter. A manager must discover support for candidate configuration, validation, or confirmed commit before relying on it.
Separate active, prepared, and boot configurations
The running datastore is active. A supported candidate datastore is a working copy for proposed changes, and a supported startup datastore holds the configuration loaded at boot. Editing candidate alone leaves running unchanged. A commit copies the prepared candidate into active use.
A lock prevents conflicting edits while the manager works. Validation checks the candidate’s rules; it does not establish that traffic will continue to behave as intended after activation.
Coordinate two devices without assuming one atomic commit
To change the MTU on a link between R1 and R2, the manager locks both candidates, sends edit-config to each, and validates both. If either validation fails, it discards both prepared changes and releases the locks before activation.
If validation succeeds, it commits on each device and checks the replies. The commits are separate: R1 can change before R2, or one commit can succeed while the other fails. The manager must detect this partial outcome and recover, for example by restoring the earlier configuration.
With confirmed commit, a device automatically reverses the change unless the manager confirms it within a set time. This helps when a new configuration cuts off management access. Each device still has its own operation and timer; confirmed commit does not make the pair a single network-wide transaction.
Use a model to reject an invalid value
A YANG module organizes data in containers, lists, and leaves. A leaf named mtu might have type uint16 and allowed range 68–65535. The value 40 violates the range, even though it fits the unsigned integer type. Model validation checks both type and constraints.
Tools can use YANG models to check NETCONF XML or RESTCONF JSON. Standard IETF interface models, vendor models, and OpenConfig models offer different data definitions. Streaming telemetry can push modeled state at intervals, complementing polling.
SNMP remains useful for monitoring individual objects. NETCONF supplies session-based configuration operations and device-level coordination primitives. Neither protocol alone guarantees that separate devices activate a network-wide change simultaneously.
Key Takeaways
- NETCONF carries configuration operations; YANG defines the managed data.
- Capabilities determine which datastores and operations a device supports.
- Editing candidate does not change running until commit.
- Locks and validation prepare a change; activation and operational checks follow.
- Separate device commits can have a partial outcome.
- Confirmed commit automatically reverses an unconfirmed change.
- A YANG constraint can reject a value that still fits its basic data type.
Routing and the Control Plane examples
1Calculate routes and follow a changed link
20 steps
- 1IntroductionBuild the rules that packets follow
A packet’s full route emerges from local forwarding decisions. Routing software must give each router a next hop that fits what the other routers will do.
Start with a weighted graph, calculate a least-cost path, and then change a link. The calculations reveal both the final route and a danger during convergence: a neighbor’s advertised cost can hide a route that comes straight back to you.
- 2ExplanationSeparate routing from forwarding
The control plane learns routes and determines forwarding state. The data plane applies that state to each arriving packet.
Traditional routers exchange routing messages and compute locally. SDN applications can compute through a controller and install rules remotely. Either arrangement still ends with a local action: match the destination or flow and select an output link.
- 3ExampleAdd costs instead of counting links
Let A–B cost 3, A–C cost 1, and C–B cost 1. The direct route A–B uses fewer links but costs more.
A sends traffic for B to C because 2 is below 3. Only when every link costs 1 does minimum total cost mean minimum hop count. The weight measures what the operator chose, not necessarily distance or packet delay.
- 4ChallengeDoes complete knowledge require one computer?
Every router holds the same topology graph and independently calculates a tree rooted at itself. Is the algorithm global, and is control running on one server?
---reveal---
The algorithm is global because each calculation uses complete topology information. Control still runs separately in each router. “Global” identifies the information available to the algorithm; it does not identify the number or location of computers executing it.
- 5ExplanationTrack tentative and final answers
Dijkstra’s algorithm keeps a settled set, tentative destination costs, and predecessors. Start with the source settled, neighbors at their direct costs, and other nodes at infinity.
Select the smallest unsettled cost, settle that node, then try paths through it to its unsettled neighbors. A predecessor records the previous node on the chosen path. Nonnegative link costs make each settlement final.
- 6ExampleStart the six-router calculation
Use links A–B 3, A–C 1, B–C 1, B–D 4, C–D 6, C–E 2, D–E 1, D–F 3, and E–F 5. Source A starts with B at 3 and C at 1; D, E, and F are unreachable by a known path.
C is the smallest unsettled candidate. Settling C gives B cost 2 through C, D cost 7 through C, and E cost 3 through C. Record C as predecessor wherever it improved the estimate.
- 7ExampleSettle B, then E
B now has the smallest tentative cost, 2. Its link to D improves D’s estimate:
E is next at cost 3. Through E, D improves again to 4 and F first becomes reachable at cost 8. D has now had estimates 7, 6, and 4. Each was tentative; none became final just because it appeared in an update.
- 8ExampleFinish and recover the first hop
Settle D at cost 4. Its link to F improves F from 8 to 7, and F is settled last.
F’s predecessor chain is F ← D ← E ← C ← A. The path A–C–E–D–F costs 7. To install A’s forwarding entry, use C, the first router after A. D is F’s predecessor but is not directly where A sends the packet. Every best path from A in this graph starts through C.
- 9ChallengeUse a different source graph
An undirected graph has Q–R 5, Q–S 2, S–R 1, R–T 3, and S–T 8. What are Q’s least cost and first hop for T?
---reveal---
Q–S–R–T costs , so Q’s first hop is S. The direct-through-R path costs 8 and Q–S–T costs 10. R is the predecessor of T on the best path; choosing R as Q’s first hop would skip the cheaper opening link through S.
- 10Key InsightCosts can change with the traffic they attract
If link cost rises with load, every router can choose the same lightly loaded path at once. That shift makes the path expensive, so the next common calculation moves traffic away again.
This feedback can oscillate even when the calculation is correct. Using load-insensitive costs removes that particular trigger. Randomized timing can also reduce synchronized changes. A static mathematical graph and a graph reacting to its own traffic have different behavior.
- 11ExplanationReplace the graph with neighbor estimates
A distance-vector router knows its attached-link costs and neighbors’ advertised destination estimates. For every other destination, it compares the total through each neighbor.
Its own distance stays 0. A new neighbor vector or changed local link triggers another calculation. Changed estimates are sent onward, letting information spread without any router storing the whole graph.
- 12ExampleCalculate from A using B’s vector
Let A–B cost 4, B–C cost 1, and A–C cost 7. B initially advertises cost 1 to C. A compares its alternatives:
A selects B as next hop for C. C similarly learns cost 5 to A through B. The following exchange changes nothing. The routers have converged without A needing a description of B’s link to C.
- 13ChallengeInclude the first-link cost
J reaches neighbors K and L at costs 2 and 7. They advertise destination Z at costs 9 and 1. Which neighbor does J choose, and what cost does it record?
---reveal---
J records cost 8 through L. The alternatives are through K and through L. Choosing cost 1 would copy L’s estimate without paying for J’s link to L. The minimum determines both the estimate and the next hop.
- 14ConnectionRIP adds messages and timers
RIP puts a protocol around distance-vector calculation. It counts hops, uses 16 as unreachable, sends periodic updates every 30 seconds over UDP port 520, and expires an unrefreshed route after 180 seconds.
The basic algorithm advertises when its estimate changes; RIP also sends periodic protocol messages when routes are stable. Its small infinity limits count-to-infinity, but also limits usable paths to 15 hops.
- 15ExampleRaise the cost and expose a hidden dependency
Start with A–B 2, B–C 1, and A–C 20. C reaches A through B at cost 3. Now A–B rises to 40.
B still sees C’s old cost 3 and computes 4 through C. Yet C’s selected route returns to B. Both estimates sound usable while the forwarding decisions form a loop. TTL limits how long one packet can circulate; it does not correct the route estimates.
- 16ExampleWatch the estimates count upward
C hears B’s new cost 4 and advertises 5 through B. B then advertises 6, C advertises 7, and the cycle continues. This is count-to-infinity.
The direct A–C link eventually breaks the cycle. When B advertises 20, C chooses its own cost 20 instead of 21 through B. B then reaches A through C at cost 21. The slow part came from treating dependent stale estimates as fresh alternatives.
- 17ExplanationPoison the route toward its next hop
With poisoned reverse, C initially advertises infinity for A specifically toward B, because B is C’s next hop for A. B cannot use C’s route as an independent backup.
After A–B rises to 40, B advertises its direct 40. C then chooses its direct 20 and advertises that independent route. B settles at 21 through C. The defense prevents this two-router loop; longer dependency cycles can still occur.
- 18ChallengeChange the cost downward instead
Links A–B 6, B–C 2, and A–C 30 have converged. A–B falls to 3. What new costs to A do B and then C advertise?
---reveal---
B advertises 3 using its direct link. C compares its direct 30 with and advertises 5 through B. Hearing 5 does not improve B’s direct 3. The lower cost spreads cleanly here because neither router needs the other’s obsolete estimate to justify the improvement.
- 19ChallengeSeparate a loop defense from packet disposal
After a cost increase, two routers forward destination traffic to one another. A learner says, “TTL already solves the problem, so their routing estimates need no change.” What is missing?
---reveal---
TTL eventually discards each looping datagram, but later datagrams can enter the same loop. Routing must converge on consistent next hops. Poisoned reverse can block the two-router dependency during the exchange; it changes the routing information instead of merely limiting one packet’s lifetime.
- 20RecapRead a route calculation in three passes
First identify the information: a complete graph or neighbors’ destination estimates. Then follow the computation until the costs settle. Finally extract the first hop that the forwarding table needs.
For a changed link, also inspect intermediate dependencies. A final least-cost answer does not describe every forwarding decision made while routers are still converging.
2Build and scale an OSPF routing domain
14 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionFind internal paths without a flat Internet graph
- 2ExplanationGive each operator a routing boundary
- 3ExampleResolve the exit through an internal neighbor
- 4ChallengeMust neighboring ASes share an IGP?
- 5ExplanationDiscover neighbors before synchronizing state
- 6ExplanationKeep link descriptions fresh
- 7ExampleLet weights express the operator’s choice
- 8ExampleCount the DR and BDR adjacencies
- 9ChallengeCheck a LAN with a different size
- 10ExplanationKeep separate graphs for separate areas
- 11ExampleFollow traffic from one area to another
- 12ChallengeDoes an area boundary hide a changed cost?
- 13ChallengeConnect an external route to an internal change
- 14RecapIdentify the boundary before choosing the mechanism
3Follow a BGP route from advertisement to forwarding
19 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionFollow the promise as well as the packet
- 2ExplanationJoin external and internal BGP sessions
- 3ExamplePrepend the advertising AS number
- 4ChallengeReject a route that returns to your AS
- 5TipRead updates as changes, not periodic table dumps
- 6ExplanationStop at the first decisive preference
- 7ExampleLet equal earlier attributes reach hot-potato routing
- 8ExampleApply a preference before measuring the exit
- 9ChallengeDiscard a tempting low MED
- 10ConnectionUse the same route selection for anycast
- 11ExplanationDistinguish paid transit from peering
- 12ExampleKeep a customer from becoming transit between providers
- 13ChallengeReclassify a route at the next AS
- 14ExplanationSeparate a hijack from a leak
- 15ExampleWatch a local block spread internationally
- 16ExplanationCheck prefix, origin, and length against a ROA
- 17ChallengeDoes a valid origin rule out a route leak?
- 18ChallengeCombine validation, filtering, and forwarding
- 19RecapAsk three different questions about a route
4Repair a path through an SDN controller
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionTurn an application’s path into device behavior
- 2ExplanationLocate the decision and the forwarding action
- 3ExplanationFollow northbound and southbound interfaces
- 4ChallengeCan a cluster present centralized control?
- 5ExplanationMatch a packet to its highest-priority rule
- 6ExampleReceive the failed-link event
- 7ExampleCompute and install the detour
- 8ChallengeRelease one packet or program later traffic?
- 9Key InsightReact to the first packet without handling all packets
- 10ChallengeUse an event and the remaining graph
- 11RecapFollow state all the way to the switches
5Explain an ICMP report and read a path test
13 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionIdentify what the network actually reported
- 2ExplanationRead the type and the code
- 3ExampleMatch different failures to different sources
- 4ExampleFollow an oversized IPv4 packet
- 5ConnectionPreserve the IPv6 size feedback too
- 6ChallengeDiagnose a size-dependent failure
- 7ExampleMeasure ping loss against requests sent
- 8ExplanationIncrease TTL to reveal later routers
- 9ExampleRead a persistent RTT rise
- 10ChallengeRead an isolated slow router response
- 11TipTreat asterisks as timeouts, not a topology diagram
- 12ChallengeKeep arrival separate from an application listener
- 13RecapState the observation before the diagnosis
6Measure utilization and prepare a two-device change
16 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionObserve first, then change with feedback
- 2ExplanationConnect the server to managed objects
- 3ExplanationChoose a read or a notification
- 4ExampleSubtract the counter samples
- 5ExampleConvert the interval total to utilization
- 6ExplanationCheck whether the counter can hide wraps
- 7ChallengeCalculate a new measurement interval
- 8ConnectionProtect monitoring and distinguish configuration tools
- 9ExplanationDiscover capabilities and separate datastores
- 10ExamplePrepare the link’s two endpoints
- 11ExampleActivate separately and inspect the result
- 12Key InsightUse confirmed commit to recover lost access
- 13ExplanationLet YANG constrain the values
- 14ChallengeDiagnose a failed preparation
- 15ChallengeCombine activation with operational measurements
- 16RecapCheck the meaning behind each reported value
Routing and the Control Plane practice questions
Set 1: Compute routes and follow changes10 Practice Questions
Question 1 of 10
Show answerHide answer
Question 2 of 10
Show answerHide answer
Question 3 of 10
Show answerHide answer
Question 4 of 10
Show answerHide answer
Question 5 of 10
Show answerHide answer
Question 6 of 10
Show answerHide answer
Question 7 of 10
Show answerHide answer
Question 8 of 10
Show answerHide answer
Question 9 of 10
Show answerHide answer
Question 10 of 10
Show answerHide answer
Set 2: Connect internal routes to external reachability10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 3: Choose BGP routes and contain routing mistakes10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 4: Trace controller events and packet reports10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 5: Measure traffic and coordinate configuration10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 6: Resolve failures across routing and management10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Area border router
AS boundary router
AS number
AS-external-LSA
AS-PATH
Asymmetric routing
Autonomous system
B
Backbone area
Backup designated router
Bellman–Ford equation
BGP
C
Candidate datastore
Confirmed commit
Control plane
Convergence
Count-to-infinity
Counter wraparound
D
Data plane
Default route
Designated router
Dijkstra’s algorithm
Distance vector
Dynamic routing
E
eBGP
Equal-cost multipath
Export policy
F
Flow-mod
Flow-table entry
G
Gateway router
Global routing algorithm
H
Hello packet
Hot-potato routing
I
iBGP
ICMP
ICMP rate limiting
ICMP type and code
Import policy
InformRequest
Interior gateway protocol
Internet exchange point
IP anycast
L
Least-cost path
Link cost
Link utilization
Link-state advertisement
Link-state routing
LOCAL_PREF
Logical centralization
M
Management agent
Management Information Base
Maximum-prefix limit
MED
N
Neighbor Discovery
NETCONF
NEXT-HOP
Northbound interface
O
Object identifier
OpenFlow
ORIGIN
OSPF
OSPF adjacency
OSPF area
P
Packet Too Big
Packet-in
Packet-out
Path MTU black hole
Path MTU discovery
Path-vector protocol
Peering
Ping
Poisoned reverse
Port-status
Predecessor
Prefix hijack
Probe timeout
R
Reactive rule installation
RIP
Round-trip time
Route leak
Route Origin Authorization
Route origin validation
Route reflector
Route withdrawal
Routing oscillation
RPKI
Running datastore
S
SDN controller
Shortest-path tree
SNMP
SNMPv3
Software-defined networking
Southbound interface
Split horizon
Startup datastore
Streaming telemetry
Summary-LSA
T
Table-miss entry
Tentative distance
Time exceeded
Traceroute
Transit provider
Trap
Triggered update
Y
YANG
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.