RFC 1812
Requirements for IP Version 4 Routers
Requirements for IP Version 4 Routers ๐
okay bestie, this is RFC 1812 ๐ and it's giving the router rulebook. It was written by F. Baker, who is the Editor, from Cisco Systems, and it's dated June 1995. It's a Standards Track document ๐, which means it's an actual Internet standard, and it obsoletes RFC 1716 and RFC 1009 ๐ซถ
Status of This Memo ๐
This document specifies an Internet standards track protocol for the Internet community, and it's asking everyone for discussion and suggestions for improvements ๐ฌ If you want to know where this protocol stands in standardization, check the current edition of the "Internet Official Protocol Standards" (STD 1) โจ Distribution of this memo is unlimited, so share the tea ๐
PREFACE ๐ธ
okay so this doc is an updated version of RFC 1716, the older Router Requirements document ๐ฆ RFC 1716 kept all the important work the working group put in, but it didn't describe current technology well enough for the IESG to call it a current standard ๐ญ
The current editor was asked to bring everything up to date so it could work as a procurement specification and a guide for implementors ๐ He stood on the shoulders of the people who came before him and leaned heavily on expert contributors for text. Any credit goes to them, and any errors are his ๐
The content and form of this document are mostly thanks to the working group's chair, who was also the original editor and author, Philip Almquist ๐ It's also largely thanks to the previous editor, Frank Kastenholz ๐ซถ Honestly, without their efforts this document wouldn't exist ๐
Table of Contents ๐ง
1. INTRODUCTION ........................................ 6
1.1 Reading this Document .............................. 8
1.1.1 Organization ..................................... 8
1.1.2 Requirements ..................................... 9
1.1.3 Compliance ....................................... 10
1.2 Relationships to Other Standards ................... 11
1.3 General Considerations ............................. 12
1.3.1 Continuing Internet Evolution .................... 12
1.3.2 Robustness Principle ............................. 13
1.3.3 Error Logging .................................... 14
1.3.4 Configuration .................................... 14
1.4 Algorithms ......................................... 16
2. INTERNET ARCHITECTURE ............................... 16
2.1 Introduction ....................................... 16
2.2 Elements of the Architecture ....................... 17
2.2.1 Protocol Layering ................................ 17
2.2.2 Networks ......................................... 19
2.2.3 Routers .......................................... 20
2.2.4 Autonomous Systems ............................... 21
2.2.5 Addressing Architecture .......................... 21
2.2.5.1 Classical IP Addressing Architecture ........... 21
2.2.5.2 Classless Inter Domain Routing (CIDR) .......... 23
2.2.6 IP Multicasting .................................. 24
2.2.7 Unnumbered Lines and Networks Prefixes ........... 25
2.2.8 Notable Oddities ................................. 26
2.2.8.1 Embedded Routers ............................... 26
2.2.8.2 Transparent Routers ............................ 27
2.3 Router Characteristics ............................. 28
2.4 Architectural Assumptions .......................... 31
3. LINK LAYER .......................................... 32
3.1 INTRODUCTION ....................................... 32
3.2 LINK/INTERNET LAYER INTERFACE ...................... 33
3.3 SPECIFIC ISSUES .................................... 34
3.3.1 Trailer Encapsulation ............................ 34
3.3.2 Address Resolution Protocol - ARP ................ 34
3.3.3 Ethernet and 802.3 Coexistence ................... 35
3.3.4 Maximum Transmission Unit - MTU .................. 35
3.3.5 Point-to-Point Protocol - PPP .................... 35
3.3.5.1 Introduction ................................... 36
3.3.5.2 Link Control Protocol (LCP) Options ............ 36
3.3.5.3 IP Control Protocol (IPCP) Options ............. 38
3.3.6 Interface Testing ................................ 38
4. INTERNET LAYER - PROTOCOLS .......................... 39
4.1 INTRODUCTION ....................................... 39
4.2 INTERNET PROTOCOL - IP ............................. 39
4.2.1 INTRODUCTION ..................................... 39
4.2.2 PROTOCOL WALK-THROUGH ............................ 40
4.2.2.1 Options: RFC 791 Section 3.2 ................... 40
4.2.2.2 Addresses in Options: RFC 791 Section 3.1 ...... 42
4.2.2.3 Unused IP Header Bits: RFC 791 Section 3.1 ..... 43
4.2.2.4 Type of Service: RFC 791 Section 3.1 ........... 44
4.2.2.5 Header Checksum: RFC 791 Section 3.1 ........... 44
4.2.2.6 Unrecognized Header Options: RFC 791,
Section 3.1 .................................... 44
4.2.2.7 Fragmentation: RFC 791 Section 3.2 ............. 45
4.2.2.8 Reassembly: RFC 791 Section 3.2 ................ 46
4.2.2.9 Time to Live: RFC 791 Section 3.2 .............. 46
4.2.2.10 Multi-subnet Broadcasts: RFC 922 .............. 47
4.2.2.11 Addressing: RFC 791 Section 3.2 ............... 47
4.2.3 SPECIFIC ISSUES .................................. 50
4.2.3.1 IP Broadcast Addresses ......................... 50
4.2.3.2 IP Multicasting ................................ 50
4.2.3.3 Path MTU Discovery ............................. 51
4.2.3.4 Subnetting ..................................... 51
4.3 INTERNET CONTROL MESSAGE PROTOCOL - ICMP ........... 52
4.3.1 INTRODUCTION ..................................... 52
4.3.2 GENERAL ISSUES ................................... 53
4.3.2.1 Unknown Message Types .......................... 53
4.3.2.2 ICMP Message TTL ............................... 53
4.3.2.3 Original Message Header ........................ 53
4.3.2.4 ICMP Message Source Address .................... 53
4.3.2.5 TOS and Precedence ............................. 54
4.3.2.6 Source Route ................................... 54
4.3.2.7 When Not to Send ICMP Errors ................... 55
4.3.2.8 Rate Limiting .................................. 56
4.3.3 SPECIFIC ISSUES .................................. 56
4.3.3.1 Destination Unreachable ........................ 56
4.3.3.2 Redirect ....................................... 57
4.3.3.3 Source Quench .................................. 57
4.3.3.4 Time Exceeded .................................. 58
4.3.3.5 Parameter Problem .............................. 58
4.3.3.6 Echo Request/Reply ............................. 58
4.3.3.7 Information Request/Reply ...................... 59
4.3.3.8 Timestamp and Timestamp Reply .................. 59
4.3.3.9 Address Mask Request/Reply ..................... 61
4.3.3.10 Router Advertisement and Solicitations ........ 62
4.4 INTERNET GROUP MANAGEMENT PROTOCOL - IGMP .......... 62
5. INTERNET LAYER - FORWARDING ......................... 63
5.1 INTRODUCTION ....................................... 63
5.2 FORWARDING WALK-THROUGH ............................ 63
5.2.1 Forwarding Algorithm ............................. 63
5.2.1.1 General ........................................ 64
5.2.1.2 Unicast ........................................ 64
5.2.1.3 Multicast ...................................... 65
5.2.2 IP Header Validation ............................. 67
5.2.3 Local Delivery Decision .......................... 69
5.2.4 Determining the Next Hop Address ................. 71
5.2.4.1 IP Destination Address ......................... 72
5.2.4.2 Local/Remote Decision .......................... 72
5.2.4.3 Next Hop Address ............................... 74
5.2.4.4 Administrative Preference ...................... 77
5.2.4.5 Load Splitting ................................. 79
5.2.5 Unused IP Header Bits: RFC-791 Section 3.1 ....... 79
5.2.6 Fragmentation and Reassembly: RFC-791,
Section 3.2 ...................................... 80
5.2.7 Internet Control Message Protocol - ICMP ......... 80
5.2.7.1 Destination Unreachable ........................ 80
5.2.7.2 Redirect ....................................... 82
5.2.7.3 Time Exceeded .................................. 84
5.2.8 INTERNET GROUP MANAGEMENT PROTOCOL - IGMP ........ 84
5.3 SPECIFIC ISSUES .................................... 85
5.3.1 Time to Live (TTL) ............................... 85
5.3.2 Type of Service (TOS) ............................ 86
5.3.3 IP Precedence .................................... 87
5.3.3.1 Precedence-Ordered Queue Service ............... 88
5.3.3.2 Lower Layer Precedence Mappings ................ 89
5.3.3.3 Precedence Handling For All Routers ............ 90
5.3.4 Forwarding of Link Layer Broadcasts .............. 92
5.3.5 Forwarding of Internet Layer Broadcasts .......... 92
5.3.5.1 Limited Broadcasts ............................. 93
5.3.5.2 Directed Broadcasts ............................ 93
5.3.5.3 All-subnets-directed Broadcasts ................ 94
5.3.5.4 Subnet-directed Broadcasts .................... 94
5.3.6 Congestion Control ............................... 94
5.3.7 Martian Address Filtering ........................ 96
5.3.8 Source Address Validation ........................ 97
5.3.9 Packet Filtering and Access Lists ................ 97
5.3.10 Multicast Routing ............................... 98
5.3.11 Controls on Forwarding .......................... 98
5.3.12 State Changes ................................... 99
5.3.12.1 When a Router Ceases Forwarding ............... 99
5.3.12.2 When a Router Starts Forwarding ............... 100
5.3.12.3 When an Interface Fails or is Disabled ........ 100
5.3.12.4 When an Interface is Enabled .................. 100
5.3.13 IP Options ...................................... 101
5.3.13.1 Unrecognized Options .......................... 101
5.3.13.2 Security Option ............................... 101
5.3.13.3 Stream Identifier Option ...................... 101
5.3.13.4 Source Route Options .......................... 101
5.3.13.5 Record Route Option ........................... 102
5.3.13.6 Timestamp Option .............................. 102
6. TRANSPORT LAYER ..................................... 103
6.1 USER DATAGRAM PROTOCOL - UDP ....................... 103
6.2 TRANSMISSION CONTROL PROTOCOL - TCP ................ 104
7. APPLICATION LAYER - ROUTING PROTOCOLS ............... 106
7.1 INTRODUCTION ....................................... 106
7.1.1 Routing Security Considerations .................. 106
7.1.2 Precedence ....................................... 107
7.1.3 Message Validation ............................... 107
7.2 INTERIOR GATEWAY PROTOCOLS ......................... 107
7.2.1 INTRODUCTION ..................................... 107
7.2.2 OPEN SHORTEST PATH FIRST - OSPF .................. 108
7.2.3 INTERMEDIATE SYSTEM TO INTERMEDIATE SYSTEM -
DUAL IS-IS ....................................... 108
1. INTRODUCTION โจ
okay bestie, this memo replaces RFC 1716, "Requirements for Internet Gateways" ([INTRO:1]) ๐
This memo is all about requirements for devices that do the network layer forwarding job in the Internet protocol suite. ๐ฆ The Internet community usually calls these devices IP routers, or just routers. The OSI community calls them intermediate systems. Older Internet docs called them gateways, but that name has mostly fallen out of favor because it gets confused with application gateways ๐
An IP router is different from other packet switching devices in one main way: it looks at the IP protocol header as part of switching. โจ It usually strips off the Link Layer header the message came in with, changes the IP header, and then slaps a new Link Layer header on for retransmission. Main character energy ๐
The authors of this memo know, and so should you, that lots of routers support more than one protocol. ๐ Multiple protocol suites are going to be needed in more and more of the Internet over time. This memo doesn't try to set Internet requirements for protocol suites other than TCP/IP, though, so we're staying in our lane ๐ซถ
This document lists the standard protocols that a router connected to the Internet MUST use. It also pulls in the RFCs and other docs that describe the current specs for those protocols, by reference. ๐ง It fixes mistakes in those referenced documents and adds extra discussion and guidance for implementors. ๐
For each protocol, this memo also has a set of requirements, recommendations, and options. ๐ Here's the tea: the list of requirements in this memo is not complete all by itself. The full set of requirements for an Internet protocol router is mainly defined in the standard protocol specification documents, plus the corrections, amendments, and supplements in this memo. You need both, bestie ๐
This memo should be read alongside the Requirements for Internet Hosts RFCs ([INTRO:2] and [INTRO:3]). ๐ฆ Internet hosts and routers MUST both be capable of originating IP datagrams and of receiving IP datagrams destined for them. The big difference is that routers implement forwarding algorithms, while Internet hosts don't need forwarding capabilities. โจ Any Internet host acting as a router MUST adhere to the requirements in this memo, no exceptions ๐
Open system interconnection means routers MUST function correctly as Internet hosts when they need to. ๐ธ So this memo gives guidelines for those situations. To keep things simple and easy to update, it tries not to overlap with the host discussions in [INTRO:2] and [INTRO:3], and it pulls in the relevant requirements from those documents by reference. In some cases, though, this document supersedes the requirements stated in [INTRO:2] and [INTRO:3]. ๐
A good-faith implementation of the protocols, built after careful reading of the RFCs, SHOULD differ from this memo's requirements only in minor ways. ๐ซถ Getting there often takes some interaction with the Internet technical community, and it MUST follow good communications software engineering practices. ๐ฅ In lots of cases, the requirements here are already stated or implied in the standard protocol documents, so repeating them is kind of redundant ๐ They're included anyway because some past implementation made the wrong choice, and that caused interoperability, performance, and/or robustness problems ๐ญ
This memo includes discussion and explanation for many of the requirements and recommendations, because a plain list would be risky. ๐ Here's why:
- Some required features matter more than others, and some features are optional. ๐
- Some features are critical in some router applications and irrelevant in others. ๐ง
- Vendor products built for restricted contexts may have valid reasons to use different specifications. ๐
Even so, the specifications of this memo MUST be followed to reach the general goal of arbitrary router interoperation across the diversity and complexity of the Internet. ๐ Most current implementations fail to meet these requirements in various ways, some minor and some major, but this specification is the ideal we need to move toward. โจ
These requirements are based on the current level of Internet architecture. ๐ฆ This memo will be updated as needed to add clarifications, or to include more information in areas where specifications are still evolving. ๐ธ
1.1 Reading this Document ๐
1.1.1 Organization
Okay so this memo copies the layered setup from [INTRO:2] and [INTRO:3] ๐ง Chapter 2 walks through the layers of the Internet architecture, and Chapter 3 is the Link Layer. Chapters 4 and 5 cover the Internet Layer protocols and forwarding algorithms, and Chapter 6 is the Transport Layer. Upper layer stuff gets split across Chapters 7, 8, and 9: Chapter 7 is about the protocols routers use to swap routing info with each other, Chapter 8 is network management, and Chapter 9 is the other upper layer protocols. The final chapter covers operations and maintenance features ๐ง This layout was picked for simplicity, clarity, and so it matches the Host Requirements RFCs. The appendices are a bibliography, a glossary, and some conjectures about where router standards might go next ๐ฎ
Now the layering thing ๐ We assume an implementation strictly mirrors the layering of the protocols. Strict layering is kinda an imperfect model though, both for the protocol suite and for the recommended implementation approaches. Protocols in different layers interact in complex and sometimes subtle ways, and a lot of functions span multiple layers. There are tons of design choices in an implementation, and many of them involve creatively breaking strict layering ๐ Every implementor is urged to read [INTRO:4] and [INTRO:5], no excuses bestie ๐
Each major section of this memo is split into these subsections:
- Introduction
- Protocol Walk-Through - goes through the protocol specification documents section by section, fixes errors, calls out requirements that might be ambiguous or ill-defined, and gives extra clarification or explanation โจ
- Specific Issues - talks about protocol design and implementation issues that didn't fit in the walk-through ๐
Under a lot of the individual topics you'll see parenthetical material labeled DISCUSSION or IMPLEMENTATION. The DISCUSSION bits are there to justify, clarify, or explain the requirement text right before them. The IMPLEMENTATION bits are suggested approaches an implementor might wanna consider. Just know that the DISCUSSION and IMPLEMENTATION sections are not part of the standard ๐
1.1.2 Requirements
Here's the deal: in this memo, the words that define how important each requirement is get capitalized. Here they are, with the vibes for each one:
- MUST: This word means the item is an absolute requirement of the specification. Breaking it is a fundamental error, and there's never a case where that's justified ๐ซ
- MUST IMPLEMENT: This phrase means the specification requires the item to be implemented, but it doesn't require the item to be turned on by default ๐
- MUST NOT: This phrase means the item is an absolute prohibition of the specification ๐
- SHOULD: This word means there may be valid reasons in particular circumstances to ignore this item, but you need to fully understand the implications and carefully weigh the case before picking a different path ๐ค
- SHOULD IMPLEMENT: This phrase is kinda like SHOULD, but it's used when we recommend a feature be provided without necessarily recommending it be enabled by default ๐ธ
- SHOULD NOT: This phrase means there may be valid reasons in particular circumstances where the described behavior is acceptable or even useful. Even so, you still need to fully understand the implications and carefully weigh the case before implementing anything described with this label ๐ง
- MAY: This word means the item is truly optional. One vendor might include it because a particular marketplace needs it or because it makes the product better, for example. Another vendor might leave the same item out ๐ฆ
1.1.3 Compliance
Some requirements apply to all routers. Other requirements only apply to routers that implement particular features or protocols. In the paragraphs below, relevant refers to the union of the requirements that apply to all routers and the set of requirements that apply to a particular router because of the features and protocols it has implemented ๐งฉ
Note that not every Relevant requirement is stated directly in this memo. Various parts of this memo pull in sections of the Host Requirements specification by reference, from [INTRO:2] and [INTRO:3]. For figuring out compliance with this memo, it doesn't matter whether a Relevant requirement is stated directly here or just incorporated by reference from one of those documents ๐
An implementation is said to be conditionally compliant if it satisfies all the Relevant MUST, MUST IMPLEMENT, and MUST NOT requirements. An implementation is said to be unconditionally compliant if it is conditionally compliant and also satisfies all the Relevant SHOULD, SHOULD IMPLEMENT, and SHOULD NOT requirements. An implementation is not compliant if it is not conditionally compliant (i.e., it fails to satisfy one or more of the Relevant MUST, MUST IMPLEMENT, or MUST NOT requirements) ๐ฏ
This specification occasionally indicates that an implementation SHOULD implement a management variable, and that it SHOULD have a certain default value. An unconditionally compliant implementation implements the default behavior, and if there are other implemented behaviors, it implements the variable too. A conditionally compliant implementation clearly documents what the default setting of the variable is or, if the variable isn't implemented, what the default may be construed to be. An implementation that both fails to implement the variable and chooses a different behavior is not compliant ๐ โโ๏ธ
For any of the SHOULD and SHOULD NOT requirements, a router may provide a configuration option that will make the router act other than as the requirement specifies. Having that option doesn't void a router's claim to unconditional compliance if the option has a default setting, and that setting makes the router operate in the required manner ๐๏ธ
Likewise, routers may provide, except where this memo explicitly prohibits it, options that cause them to violate MUST or MUST NOT requirements. A router that provides such options is compliant (fully or conditionally) if and only if each of those options has a default setting that makes the router conform to the requirements of this memo. Please note that the authors of this memo, although aware of market realities, strongly recommend against providing such options ๐จ Requirements are labeled MUST or MUST NOT because experts in the field judged them to be especially important for interoperability or for the proper functioning of the Internet. Vendors should weigh the customer support costs of offering options that violate those rules very carefully ๐ธ
Of course, this memo isn't a complete specification of an IP router. It's closer to what the OSI world calls a profile โจ For example, this memo requires that a number of protocols be implemented. Most of the contents of their protocol specifications aren't repeated here, but implementors are still required to implement the protocols according to those specifications ๐
1.2 Relationships to Other Standards
There are several reference documents worth knowing about when you're checking the status of protocol specifications and standardization ๐
- INTERNET OFFICIAL PROTOCOL STANDARDS: This document describes the Internet standards process and lists the standards status of the protocols. As of this writing, the current version is STD 1, RFC 1780, [ARCH:7]. This document is periodically re-issued, so always check an RFC repository and use the latest version ๐๏ธ
- Assigned Numbers: This document lists the assigned values of the parameters used in the various protocols. For example, it lists IP protocol codes, TCP port numbers, Telnet Option Codes, ARP hardware types, and Terminal Type names. As of this writing, the current version is STD 2, RFC 1700, [INTRO:7]. This document is periodically re-issued, so always check an RFC repository and use the latest version ๐ข
- Host Requirements: This pair of documents reviews the specifications that apply to hosts and gives guidance and clarification for any ambiguities. These requirements also apply to routers, except where this memo specifies otherwise. As of this writing, the current versions are RFC 1122 and RFC 1123 (STD 3), [INTRO:2] and [INTRO:3] ๐ฅ๏ธ
- Router Requirements (formerly Gateway Requirements): This memo. ๐
These documents get revised and updated at different times. If there are differences between them, the most recent one prevails ๐
You can get these and other Internet protocol documents from:
The InterNIC
DS.INTERNIC.NET
InterNIC Directory and Database Service
info@internic.net
+1-908-668-6587
URL: http://ds.internic.net/
1.3 General Considerations
There are a few important lessons that vendors of Internet software have learned, and a new vendor should seriously consider them ๐
1.3.1 Continuing Internet Evolution
Okay the Internet has grown SO much, and that growth has revealed problems with managing and scaling a large datagram-based packet communication system ๐ญ People are working on these problems, so the specifications in this memo are going to keep evolving. New routing protocols, algorithms, and architectures are constantly being developed. New Internet layer protocols, and changes to existing ones, are constantly being devised too ๐ Routers play a crucial role in the Internet, and there are way fewer routers deployed than hosts. So vendors should expect router standards to keep evolving much faster than host standards ๐โโ๏ธ These changes will be carefully planned and controlled, since vendors and the organizations that run the networks are heavily involved in that planning ๐ค
Development, evolution, and revision are just characteristic of computer network protocols today, and this situation is going to last for some years. A vendor who builds computer communications software for the Internet protocol suite (or any other protocol suite!) and then doesn't maintain and update it as the specifications change is going to leave a trail of unhappy customers ๐ The Internet is a huge communication network, and users are in constant contact through it. Experience has shown that news of deficiencies in vendor software spreads fast through the Internet technical community ๐ฃ Bestie, you have been warned! ๐
1.3.2 Robustness Principle ๐ก๏ธ
Okay so at every layer of the protocols there's this general rule (from [TRANS:2] by Jon Postel) that can lead to enormous benefits in robustness and interoperability. It's giving main character energy โจ
Be conservative in what you do,
be liberal in what you accept from others.
Software needs to be ready for every conceivable error, even the super unlikely ones ๐ Eventually a packet is gonna show up with that exact combo of errors and attributes, and if the software isn't prepared, chaos can ensue. The safest move is to assume the network is full of malevolent entities sending packets designed to cause the worst possible damage ๐ That assumption leads to suitably protective design ๐ซถ The biggest problems on the Internet came from unforeseen mechanisms triggered by low probability events. Mere human malice would never have taken so devious a course! ๐ญ
Adaptability to change has to be built into every level of router software ๐ฆ For example, say a protocol spec lists out a set of values for a header field, like a type field, a port number, or an error code. That list has to be treated as incomplete. If the spec defines four possible error codes, the software must not break when a fifth one gets defined. An undefined code might be logged, but it must not cause a failure.
The second part of the principle is almost as important ๐ Software on hosts or other routers might have deficiencies that make it unwise to exploit legal but obscure protocol features. Don't stray far from the obvious and simple, or you could cause weird effects somewhere else. A corollary of this is to watch out for misbehaving hosts. Router software should be prepared to survive in the presence of misbehaving hosts. An important job of routers on the Internet is to limit how much disruption those hosts can inflict on the shared communication facility ๐ธ
1.3.3 Error Logging ๐
The Internet has a huge variety of systems, each implementing many protocols and protocol layers, and some of them have bugs and misguided features in their Internet protocol software ๐ Because of all that complexity, diversity, and distribution of function, diagnosing problems is often super hard.
Problem diagnosis gets a lot easier if routers include a carefully designed facility for logging erroneous or strange events ๐ It's important to include as much diagnostic information as possible when an error is logged. In particular, it's often useful to record the header(s) of the packet that caused the error. However, care must be taken to make sure error logging doesn't consume prohibitive amounts of resources or otherwise interfere with the router's operation. Not worth crashing the whole vibe over a log file ๐
There's a tendency for abnormal but harmless protocol events to overflow error logging files. This can be avoided by using a circular log, or by only enabling logging while you're diagnosing a known failure. It may be useful to filter and count duplicate successive messages. One strategy that seems to work well is to do both of these things:
- Always count abnormalities and make those counts accessible through the management protocol (see Chapter 8); and
- Allow the logging of a great variety of events to be selectively enabled. For example, it might be useful to be able to log everything, or to log everything for host X.
This topic is further discussed in [MGT:5] ๐ง
1.3.4 Configuration โ๏ธ
In an ideal world, routers would be easy to configure, and maybe even entirely self-configuring ๐ But real world experience suggests that this is an impossible goal. Lots of vendor attempts to make configuration easy actually cause customers more grief than they prevent ๐ฉ As an extreme example, a router designed to come up and start routing packets without any configuration information at all would almost certainly pick some incorrect parameter. That could cause serious problems on any networks unlucky enough to be connected to it.
This memo often requires that a parameter be a configurable option, and there are a few reasons for that ๐ In some cases there's still some uncertainty or disagreement about the best value, so the recommended value might need updating in the future. In other cases the value really depends on external factors, like the distribution of communication load or the speeds and topology of nearby networks. Self-tuning algorithms aren't available for those, and might not be enough anyway. In some cases configurability is needed because of administrative requirements.
Finally, some configuration options are needed to talk to obsolete or incorrect implementations of the protocols. These are distributed without sources and still hang around in lots of parts of the Internet ๐ฅฒ To make correct systems coexist with these faulty systems, administrators must occasionally misconfigure the correct systems. This will fix itself gradually as the faulty systems get retired, but vendors can't ignore it.
When we say a parameter must be configurable, we don't mean its value has to be explicitly read from a configuration file at every boot time ๐ For many parameters there's one value that's appropriate for all but the most unusual situations. In those cases it's totally reasonable for the parameter to default to that value if it isn't explicitly set.
This memo requires a particular value for such defaults in some cases. Choosing the default is a sensitive issue when the configuration item controls how existing, faulty systems get accommodated. If the Internet is going to converge successfully to complete interoperability, the default values built into implementations must implement the official protocol, not misconfigurations that accommodate faulty implementations. Marketing considerations have led some vendors to pick misconfiguration defaults, but we urge vendors to choose defaults that conform to the standard ๐
Last thing: vendors need to provide adequate documentation on all configuration parameters, including their limits and effects ๐
1.4 Algorithms ๐งฎ
In several places in this memo, specific algorithms that a router ought to follow are specified. These algorithms aren't, per se, required of the router. A router doesn't need to implement each algorithm exactly as it's written here. What matters is that an implementation presents a behavior to the external world that's the same as a strict, literal implementation of the specified algorithm ๐
The algorithms are described differently than a good implementor would actually build them. For expository purposes, a style that emphasizes conciseness, clarity, and independence from implementation details was chosen. A good implementor will pick algorithms and implementation methods that produce the same results as these, but those might be more efficient or less general ๐ฅ
We note that the art of efficient router implementation is outside the scope of this memo ๐คทโโ๏ธ
2. INTERNET ARCHITECTURE ๐
This chapter doesn't contain any requirements. It does contain useful background info on the general architecture of the Internet and of routers โจ
General background and discussion on the Internet architecture and supporting protocol suite can be found in the DDN Protocol Handbook [ARCH:1]. For background, see for example [ARCH:2], [ARCH:3], and [ARCH:4]. The Internet architecture and protocols are also covered in an ever-growing number of textbooks, such as [ARCH:5] and [ARCH:6] ๐
2.1 Introduction ๐ฆ
The Internet system is a bunch of interconnected packet networks supporting communication among host computers using the Internet protocols. These protocols include the Internet Protocol (IP), the Internet Control Message Protocol (ICMP), the Internet Group Management Protocol (IGMP), and a variety of transport and application protocols that depend on them. As was described in Section [1.2], the Internet Engineering Steering Group periodically releases an Official Protocols memo listing all the Internet protocols ๐
All Internet protocols use IP as the basic data transport mechanism. IP is a datagram, or connectionless, internetwork service, and it includes provision for addressing, type-of-service specification, fragmentation and reassembly, and security ๐ซถ ICMP and IGMP are considered integral parts of IP, even though they're architecturally layered upon IP. ICMP provides error reporting, flow control, first-hop router redirection, and other maintenance and control functions. IGMP provides the mechanisms by which hosts and routers can join and leave IP multicast groups ๐
Reliable data delivery is provided in the Internet protocol suite by Transport Layer protocols such as the Transmission Control Protocol (TCP), which provides end-end retransmission, resequencing, and connection control. Transport Layer connectionless service is provided by the User Datagram Protocol (UDP) ๐
2.2 Elements of the Architecture ๐งฉ
2.2.1 Protocol Layering โจ
Okay bestie, so to talk on the Internet system, a host has to implement the whole layered stack of protocols that make up the Internet protocol suite ๐ A host typically must implement at least one protocol from each layer. ๐ซถ
Here are the protocol layers in the Internet architecture [ARCH:7]:
- Application Layer ๐ This is the top layer of the suite. The Internet suite doesn't split it up any further, though some application protocols have their own little internal sub-layers. Basically, the Application Layer in the Internet suite squishes together the top two layers of the OSI Reference Model [ARCH:8], which are Presentation and Application. It also picks up some of the stuff OSI gave to its Session Layer. ๐ง
We sort application protocols into two groups: user protocols that serve people directly, and support protocols that handle common system jobs. The most popular Internet user protocols are:
- Telnet (remote login)
- FTP (file transfer)
- SMTP (electronic mail delivery)
There are loads of other standardized user protocols, plus tons of private ones ๐
Support protocols handle host name mapping, booting, and management. They include SNMP, BOOTP, TFTP, the Domain Name System (DNS) protocol, and a variety of routing protocols ๐
Application Layer protocols that matter to routers are covered in chapters 7, 8, and 9 of this memo ๐
- Transport Layer ๐ฆ This layer gives end-to-end communication services. It's roughly the same as the Transport Layer in the OSI Reference Model, except it also takes on some of OSI's Session Layer jobs for setting up and tearing down connections. โจ
There are two main Transport Layer protocols right now:
- Transmission Control Protocol (TCP)
- User Datagram Protocol (UDP)
TCP is a reliable, connection-oriented transport service. It gives end-to-end reliability, resequencing, and flow control ๐ฅ UDP is a connectionless (datagram) transport service. The research community has built other transport protocols too, and the set of official Internet transport protocols might grow in the future ๐ธ
Transport Layer protocols that matter to routers are discussed in Chapter 6 ๐
- Internet Layer ๐ Every Internet transport protocol uses the Internet Protocol (IP) to carry data from the source host to the destination host. IP is a connectionless, or datagram, internetwork service, and it gives no end-to-end delivery guarantees ๐ญ IP datagrams may arrive at the destination damaged, duplicated, out of order, or not at all. The layers above IP are responsible for reliable delivery when it is required. IP includes provisions for addressing, type-of-service specification, fragmentation and reassembly, and security ๐
The datagram, or connectionless, nature of IP is a fundamental and defining feature of the Internet architecture ๐
The Internet Control Message Protocol (ICMP) is a control protocol that counts as an integral part of IP, even though it sits architecturally on top of IP. It uses IP to carry its own data end-to-end. ICMP handles error reporting, congestion reporting, and first-hop router redirection ๐ซถ
The Internet Group Management Protocol (IGMP) is an Internet layer protocol used to set up dynamic host groups for IP multicasting ๐ฆ
The Internet layer protocols IP, ICMP, and IGMP are discussed in chapter 4 โจ
- Link Layer ๐ธ To communicate on a directly connected network, a host must implement the communication protocol used to interface with that network. We call this a Link Layer protocol ๐ง
Some older Internet documents call this layer the Network Layer, but it is NOT the same as the Network Layer in the OSI Reference Model. (Careful, that one's a trap ๐)
This layer covers everything below the Internet Layer and above the Physical Layer. The Physical Layer is the media connectivity, usually electrical or optical, that encodes and carries messages. The Link Layer's job is correct delivery of messages, and it doesn't tell them apart ๐
Protocols in this layer are generally outside the scope of Internet standardization, because the Internet (on purpose) uses existing standards whenever it can. So Internet Link Layer standards usually only address address resolution and the rules for sending IP packets over specific Link Layer protocols ๐ Internet Link Layer standards are discussed in chapter 3 ๐
2.2.2 Networks ๐
Okay so the networks that make up the Internet system only have to provide packet (connectionless) transport. Under the IP service specification, datagrams can be delivered out of order, get lost or duplicated, and/or contain errors ๐ญ
Protocols that use IP, like TCP, perform reasonably well only if the network's loss rate is very low. In networks with connection-oriented service, the extra reliability that virtual circuits provide makes the system more robust end-to-end, but it's not necessary for the Internet to work ๐
Constituent networks come in two classes:
- Local-Area Networks (LANs) ๐ LANs can be designed in a bunch of different ways. They usually cover a small geographic area, like a single building or plant site, and they give high bandwidth with low delays. LANs can be passive (similar to Ethernet) or active (such as ATM) โจ
- Wide-Area Networks (WANs) ๐ Geographically spread-out hosts and LANs are connected by wide-area networks, also called long-haul networks. These can have a complex internal structure of lines and packet switches, or they can be as simple as point-to-point lines ๐ฆ
2.2.3 Routers ๐บ๏ธ
In the Internet model, constituent networks get connected together by IP datagram forwarders, which are called routers or IP routers. In this document, every use of the word router means IP router. Lots of older Internet documents call routers gateways ๐
Routers used to be built as packet-switching software running on a general-purpose CPU. Custom hardware is getting cheaper, though, and as higher throughput becomes necessary, special-purpose hardware is getting more and more common ๐ฅ This specification applies to routers no matter how they're implemented ๐
A router connects to two or more logical interfaces, which are represented by IP subnets or unnumbered point-to-point lines (discussed in section [2.2.7]). So it has at least one physical interface ๐ซถ To forward an IP datagram, the router generally has to pick the address and the relevant interface of the next-hop router or, for the final hop, the destination host. This choice, called relaying or forwarding, depends on a route database inside the router. The route database is also called a routing table or forwarding table. The word "router" comes from the process of building this route database. Routing protocols and configuration work together in a process called routing ๐ง
The routing database should be maintained dynamically so it reflects the current topology of the Internet system. A router usually does this by taking part in distributed routing and reachability algorithms with other routers ๐
Routers only provide datagram transport, and they try to minimize the state information needed to keep this service running. That keeps routing flexible and robust ๐
Packet switching devices can also work at the Link Layer. These are usually called bridges. Network segments connected by bridges share the same IP network prefix and form a single IP subnet. These other devices are outside the scope of this document ๐
2.2.4 Autonomous Systems ๐
An Autonomous System (AS) is a connected part of a network topology. It's made up of a collection of subnetworks (with hosts attached) linked together by a set of routes. The subnetworks and routers are expected to be under the control of a single operations and maintenance (O&M) organization. Inside an AS, routers may use one or more interior routing protocols, and sometimes several sets of metrics. An AS is expected to show other ASs a coherent interior routing plan and a consistent picture of the destinations reachable through it. Every AS is identified by an Autonomous System number ๐
The AS concept plays an important role in Internet routing (see Section 7.1) โจ
2.2.5 Addressing Architecture ๐ก
An IP datagram carries 32-bit source and destination addresses. Each address is split into two parts: a constituent network prefix and a host number on that network. Symbolically:
IP-address ::= { <Network-prefix>, <Host-number> }
To actually deliver the datagram, the last router on its path has to map the Host-number (or rest) part of the IP address to the host's Link Layer address ๐ฏ
2.2.5.1 Classical IP Addressing Architecture โจ
Okay so this is well documented elsewhere [INTERNET:2], but it's still super useful to know how the network prefix was used historically ๐. The language they came up with for it is still used in this and other documents, and honestly it's everywhere in how people think about many protocols ๐ง .
The simplest classical network prefix is the Class A, B, C, D, or E network prefix ๐ฆ. These ranges are told apart by looking at the most significant bits of the address, and they split the address into a simple prefix and a host number ๐. This is described in [INTERNET:18]. The short version of the classification is:
0xxx - Class A - general purpose unicast addresses with standard
8 bit prefix
10xx - Class B - general purpose unicast addresses with standard
16 bit prefix
110x - Class C - general purpose unicast addresses with standard
24 bit prefix
1110 - Class D - IP Multicast Addresses - 28 bit prefix, non-
aggregatable
1111 - Class E - reserved for experimental use
This simple idea got extended with subnets ๐ธ. Subnets were introduced so an organization could have arbitrarily complicated LAN structures inside it, while the wider Internet stayed protected from explosive growth in assigned network prefixes and routing complexity ๐ . Subnets give the Internet a multi-level hierarchical routing structure. The subnet extension, described in [INTERNET:2], is a required part of the Internet architecture ๐ฅ. The basic idea is to split the <Host-number> field into two parts: a subnet number, and a true host number on that subnet ๐:
IP-address ::=
{ <Network-number>, <Subnet-number>, <Host-number> }
The physical networks inside an organization use the same network prefix but different subnet numbers ๐ซถ. Normally, the difference between the subnets of a subnetted network isn't visible outside that network ๐. So routing in the rest of the Internet only uses the <Network-prefix> part of the IP destination address โจ. Routers outside the network treat <Network-prefix> and <Host-number> together as an uninterpreted rest part of the 32-bit IP address ๐. Inside the subnetted network, the routers use the extended network prefix:
{ <Network-number>, <Subnet-number> }
Historically, the bit positions holding this extended network number were marked with a 32-bit mask called the subnet mask ๐. The <Subnet-number> bits SHOULD be contiguous and fall between the <Network-number> and the <Host-number> fields ๐. Newer protocols don't mention a subnet mask at all. They use a prefix length instead ๐. The "prefix" part of an address is whatever a subnet mask would select if its most significant bits were all ones and the rest were zeroes โญ. The length of the prefix equals the number of ones in the subnet mask ๐ง. This document assumes that all subnet masks can be written as prefix lengths ๐.
Okay, so the inventors of the subnet mechanism figured each piece of an organization's network would only ever have a single subnet number ๐ญ. In reality, it's often been necessary or useful to have several subnets share one physical cable ๐. Because of that, routers should be capable of configuring multiple subnets on the same physical interfaces, and they should treat those subnets (from a routing or forwarding point of view) as though they were distinct physical interfaces ๐ฆ.
2.2.5.2 Classless Inter Domain Routing (CIDR) ๐ธ
The explosive growth of the Internet forced everyone to rethink how addresses get assigned ๐ค. The traditional uses of general purpose (Class A, B, and C) networks got changed so IP's 32-bit address space would be used better ๐ . Classless Inter Domain Routing (CIDR) [INTERNET:15] is the method being rolled out across Internet backbones right now to get that extra efficiency โจ. CIDR depends on deploying and routing arbitrarily sized networks ๐. In this model, hosts and routers make no assumptions about how addressing is used across the internet ๐ซถ. The Class D (IP Multicast) and Class E (Experimental) address spaces are kept, although this is mostly an assignment policy ๐ฅ.
By definition, CIDR has three elements ๐:
- topologically significant address assignment,
- routing protocols that are capable of aggregating network layer reachability information, and
- consistent forwarding algorithm ("longest match").
Networks and subnets are historical now ๐ฐ๏ธ, even though we still use the language that describes them ๐. They've been replaced by the more manageable idea of a network prefix ๐ง. By definition, a network prefix is a contiguous set of bits at the more significant end of the address that defines a set of systems. Host numbers pick out individual systems within that set ๐. Nothing requires every part of the internet to use network prefixes in the same way ๐. To collapse routing information, it helps to divide the internet into addressing domains ๐. Inside a domain, detailed information is available about its constituent networks. Outside it, only the common network prefix gets advertised ๐ญ.
The classical IP addressing architecture used addresses and subnet masks to tell the host number apart from the network prefix. With network prefixes, you only need to indicate how many bits are in the prefix ๐ฆ. Both representations are in common use. Architecturally correct subnet masks can be represented with the prefix length description ๐ . They are the subset of all possible bit patterns that have:
- a contiguous string of ones at the more significant end,
- a contiguous string of zeros at the less significant end, and
- no intervening bits.
Routers SHOULD always treat a route as a network prefix, and they SHOULD reject configuration and routing information that doesn't fit that model ๐ซโจ.
IP-address ::= { <Network-prefix>, <Host-number> }
Because of CIDR, the set of destinations tied to address prefixes in the routing table may show a subset relationship ๐. A route describing a smaller set of destinations (a longer prefix) is said to be more specific than a route describing a larger set of destinations (a shorter prefix). Likewise, a route describing a larger set of destinations (a shorter prefix) is said to be less specific than a route describing a smaller set of destinations (a longer prefix) ๐. Routers must use the most specific matching route (the longest matching network prefix) when forwarding traffic ๐ฅ.
2.2.6 IP Multicasting ๐ฃ
IP multicasting is an extension of Link Layer multicast to IP internets ๐ฆ. With IP multicasts, a single datagram can be addressed to multiple hosts without being sent to all of them ๐ซถ. In the extended case, those hosts can live in different address domains ๐. This collection of hosts is called a multicast group ๐. Each multicast group is represented as a Class D IP address ๐. An IP datagram sent to the group is supposed to be delivered to each group member with the same best-effort delivery that unicast IP traffic gets ๐ง. The sender doesn't need to be a member of the destination group itself ๐.
The semantics of IP multicast group membership are defined in [INTERNET:4] ๐. That document explains how hosts and routers join and leave multicast groups ๐ธ. It also defines a protocol, the Internet Group Management Protocol (IGMP), that monitors IP multicast group membership ๐.
Forwarding of IP multicast datagrams happens either through static routing information or through a multicast routing protocol ๐. Devices that forward IP multicast datagrams are called multicast routers ๐ฐ๏ธ. They may or may not forward IP unicasts too ๐คทโโ๏ธ. Multicast datagrams get forwarded based on both their source and destination addresses ๐. Forwarding of IP multicast packets is covered in more detail in Section [5.2.1] โจ. Appendix D talks about multicast routing protocols ๐.
2.2.7 Unnumbered Lines and Networks Prefixes ๐ซ
Traditionally, every network interface on an IP host or router has its own IP address ๐ . This can waste the scarce IP address space, because it forces a whole IP network prefix to be allocated to every point-to-point link ๐ฉ.
To fix this, a bunch of people proposed and implemented the idea of unnumbered point to point lines ๐ก. An unnumbered point to point line doesn't have any network prefix attached to it ๐. As a result, the network interfaces connected to an unnumbered point to point line don't have IP addresses ๐.
The IP architecture has always assumed every interface has an IP address, so these unnumbered interfaces cause some interesting dilemmas ๐คฏ. For example, some IP options (e.g., Record Route) say a router must insert the interface address into the option, but an unnumbered interface has no IP address ๐. Even more fundamentally (as we shall see in chapter 5), routes contain the IP address of the next hop router ๐งญ. A router expects that this IP address will be on an IP (sub)net the router is connected to ๐. That assumption gets broken if the only connection is an unnumbered point to point line ๐.
There are two schemes for getting around these problems ๐ง. The first scheme says two routers connected by an unnumbered point to point line aren't really two routers at all. They're two half-routers that together make up a single virtual router ๐ฏ. The unnumbered point to point line is basically treated as an internal bus inside the virtual router ๐. The two halves of the virtual router have to coordinate so they act exactly like a single router ๐ซถ.
This scheme fits nicely into the IP architecture, but it has two big drawbacks ๐ฌ. The first is that, although it handles the common case of a single unnumbered point to point line, it doesn't extend easily to a mesh of routers and unnumbered point to point lines ๐ธ๏ธ. The second is that the interactions between the half routers are necessarily complex and aren't standardized, which effectively rules out connecting equipment from different vendors using unnumbered point to point lines ๐ โโ๏ธ.
Because of those drawbacks, this memo went with an alternate scheme ๐. That scheme has been invented multiple times, but it's probably originally attributable to Phil Karn ๐. In this scheme, a router with unnumbered point to point lines also has a special IP address, called a router-id in this memo ๐ชช. The router-id is one of the router's IP addresses (a router is required to have at least one IP address) ๐ . This router-id gets used as if it were the IP address of all unnumbered interfaces ๐ฆ.
2.2.8 Notable Oddities ๐
2.2.8.1 Embedded Routers
okay so a router can be a stand-alone computer system that's dedicated to just being an IP router ๐ฅ๏ธโจ but plot twist: you can also embed router functions inside a host operating system that's connected to two or more networks ๐ง. The best-known example of an OS with embedded router code is the Berkeley BSD system ๐ธ. Embedded routers seem like they make building a network super easy, but ngl there are some hidden pitfalls ๐
- If a host has only a single constituent-network interface, it SHOULD NOT act as a router.
For example, hosts with embedded router code that gratuitously forward broadcast packets or datagrams on the same net often cause packet avalanches ๐.
- If a (multihomed) host acts as a router, it is subject to the requirements for routers contained in this document ๐.
For example, the routing protocol issues and the router control and monitoring problems are as hard and important for embedded routers as for stand-alone routers ๐ญ.
Internet router requirements and specifications may change independently of operating system changes. An administration that operates an embedded router in the Internet is strongly advised to maintain and update the router code. This might require router source code ๐ซถ.
- When a host executes embedded router code, it becomes part of the Internet infrastructure. Thus, errors in software or configuration can hinder communication between other hosts. As a consequence, the host administrator must lose some autonomy ๐ฅบ.
In many circumstances, a host administrator will need to disable router code embedded in the operating system. For this reason, it SHOULD be straightforward to disable embedded router functionality โจ.
- When a host running embedded router code is concurrently used for other services, the Operation and Maintenance requirements for the two modes of use may conflict ๐ตโ๐ซ.
For example, router O&M will in many cases be performed remotely by an operations center. This may require privileged system access that the host administrator would not normally want to distribute ๐.
2.2.8.2 Transparent Routers
okay so there are two basic models for connecting local-area networks to wide-area (or long-haul) networks in the Internet ๐. In the first one, the local-area network gets its own network prefix, and all routers in the Internet MUST know how to route to that network. In the second one, the local-area network shares (a small part of) the address space of the wide-area network ๐ฆ. Routers that support this second model are called address sharing routers or transparent routers. The focus of this memo is on routers that support the first model, but that is not meant to rule out transparent routers ๐.
The basic idea of a transparent router is that the hosts on the local-area network behind it share the address space of the wide-area network in front of it. In certain situations this is a very useful approach, and the limitations don't present significant drawbacks ๐.
The words "in front" and "behind" point to one of the limitations here: this model is only suitable for a geographically (and topologically) limited stub environment ๐งธ. It requires that there be some form of logical addressing in the network-level addressing of the wide-area network. IP addresses in the local environment map to a few (usually one) physical address in the wide-area network. This mapping has to happen in a way that's consistent with the { IP address <-> network address } mapping used throughout the wide-area network ๐บ๏ธ.
Multihoming is possible on one wide-area network, but it may cause routing problems if the interfaces are geographically or topologically separated ๐ค. Multihoming on two (or more) wide-area networks is a problem because of the confusion of addresses ๐ฌ.
The behavior that hosts see from other hosts in what looks like the same network may differ if the transparent router can't fully emulate the normal wide-area network service ๐. For example, the ARPANET used a Link Layer protocol that gave a Destination Dead indication when you tried to send to a host that was off-line. But if there were a transparent router between the ARPANET and an Ethernet, a host on the ARPANET would NOT get a Destination Dead indication for Ethernet hosts ๐
.
2.3 Router Characteristics
okay, so an Internet router does a bunch of jobs ๐ง โจ
- Conforms to specific Internet protocols specified in this document, including the Internet Protocol (IP), Internet Control Message Protocol (ICMP), and others as necessary ๐.
- Interfaces to two or more packet networks. For each connected network, the router MUST implement the functions required by that network ๐. These functions typically include:
- Encapsulating and decapsulating the IP datagrams with the connected network framing (e.g., an Ethernet header and checksum),
- Sending and receiving IP datagrams up to the maximum size supported by that network. This size is the network's Maximum Transmission Unit or MTU,
- Translating the IP destination address into an appropriate network-level address for the connected network (e.g., an Ethernet hardware address), if needed, and
- Responding to network flow control and error indications, if any.
See chapter 3 (Link Layer).
- Receives and forwards Internet datagrams. Important issues in this process are buffer management, congestion control, and fairness ๐ฆ.
- Recognizes error conditions and generates ICMP error and information messages as required.
- Drops datagrams whose time-to-live fields have reached zero โณ.
- Fragments datagrams when necessary to fit into the MTU of the next network.
See chapter 4 (Internet Layer - Protocols) and chapter 5 (Internet Layer - Forwarding) for more information.
- Chooses a next-hop destination for each IP datagram, based on the information in its routing database ๐บ๏ธ. See chapter 5 (Internet Layer - Forwarding) for more information.
- (Usually) supports an interior gateway protocol (IGP) to carry out distributed routing and reachability algorithms with the other routers in the same autonomous system. In addition, some routers will need to support an exterior gateway protocol (EGP) to exchange topological information with other autonomous systems ๐. See chapter 7 (Application Layer - Routing Protocols) for more information.
- Provides network management and system support facilities, including loading, debugging, status reporting, exception reporting and control ๐ ๏ธ. See chapter 8 (Application Layer - Network Management Protocols) and chapter 10 (Operation and Maintenance) for more information.
A router vendor has lots of choices on power, complexity, and features for a particular router product ๐. It's helpful to know that the Internet system is neither homogeneous nor fully connected. For reasons of technology and geography, it's growing into a global interconnect system plus a fringe of LANs around the edge ๐. More and more, these fringe LANs are getting richly interconnected, which makes them less out on the fringe and more demanding on router requirements ๐.
- The global interconnect system is composed of a number of wide-area networks to which are attached routers of several Autonomous Systems (AS). There are relatively few hosts connected directly to the system ๐ฐ๏ธ.
- Most hosts are connected to LANs. Many organizations have clusters of LANs interconnected by local routers. Each such cluster is connected by routers at one or more points into the global interconnect system. If it is connected at only one point, a LAN is known as a stub network ๐งธ.
Routers in the global interconnect system generally require:
- Advanced Routing and Forwarding Algorithms
These routers need routing algorithms that are highly dynamic, impose minimal processing and communication burdens, and offer type-of-service routing. Congestion is still not a completely resolved issue (see Section [5.3.6]). Improvements in these areas are expected, as the research community is actively working on these issues ๐งช.
- High Availability
These routers need to be highly reliable, providing 24 hours a day, 7 days a week service. Equipment and software faults can have a wide-spread (sometimes global) effect. In case of failure, they MUST recover quickly ๐จ. In any environment, a router MUST be highly robust and able to operate, possibly in a degraded state, under conditions of extreme congestion or failure of network resources ๐ช.
- Advanced O&M Features
Internet routers normally operate in an unattended mode. They will typically be operated remotely from a centralized monitoring center. They need to provide sophisticated means for monitoring and measuring traffic and other events and for diagnosing faults ๐.
- High Performance
Long-haul lines in the Internet today are most frequently full duplex 56 KBPS, DS1 (1.544 Mbps), or DS3 (45 Mbps) speeds. LANs, which are half duplex multiaccess media, are typically Ethernet (10Mbps) and, to a lesser degree, FDDI (100Mbps). However, network media technology is constantly advancing, and higher speeds are likely in the future ๐๏ธ.
The requirements for routers used in the LAN fringe (e.g., campus networks) depend greatly on the demands of the local networks ๐ซ. These may be high or medium-performance devices, probably competitively procured from several different vendors and operated by an internal organization (e.g., a campus computing center). The design of these routers SHOULD emphasize low average latency and good burst performance, together with delay and type-of-service sensitive resource management ๐ฏ. In this environment there may be less formal O&M, but it will not be less important ๐. The need for the routing mechanism to be highly dynamic will become more important as networks become more complex and interconnected. Users will demand more out of their local connections because of the speed of the global interconnects ๐.
As networks have grown, and as more networks have become old enough that they are phasing out older equipment, it has become increasingly imperative that routers interoperate with routers from other vendors ๐ค.
Even though the Internet system is not fully interconnected, many parts of the system need redundant connectivity ๐. Rich connectivity allows reliable service despite failures of communication lines and routers, and it can also improve service by shortening Internet paths and by providing additional capacity. Unfortunately, this richer topology can make it much more difficult to choose the best path to a particular destination ๐ต.
2.4 Architectural Assumptions โจ
okay bestie, the Internet's architecture runs on a bunch of assumptions about how the communication system works, and these are the ones that matter most for routers ๐
- The Internet is a network of networks. ๐
Each host is directly connected to some particular network(s), so its connection to the Internet is only conceptual ๐ซง Two hosts on the same network talk using the same set of protocols they'd use with hosts on distant networks. It's all one vibe ๐ซถ
- Routers do not keep connection state information. ๐ โโ๏ธ
Routers are designed to be stateless so the whole communication system stays robust. Each IP packet gets forwarded independently of the others, which means redundant paths can be used to keep service running even when intervening routers and networks fail ๐ฅ
All the state needed for end-to-end flow control and reliability lives in the hosts, in the transport layer or in application programs. That means all the connection control info sits right at the endpoints of the communication, so it only gets lost if an endpoint fails ๐ Routers control message flow only indirectly, by dropping packets or increasing network delay.
Future protocol developments may totally put some more state into routers ๐ This is especially likely for multicast routing, resource reservation, and flow based forwarding.
- Routing complexity should be in the routers. ๐งญ
Routing is a complex and difficult problem, so it ought to be handled by the routers, not the hosts. The big goal is to insulate host software from changes caused by the inevitable evolution of the Internet routing architecture ๐
- The system must tolerate wide network variation. ๐
The Internet is built to handle a wide range of network characteristics, like bandwidth, delay, packet loss, packet reordering, and maximum packet size ๐ญ It's also supposed to be robust against failure of individual networks, routers, and hosts, using whatever bandwidth is still available. And the goal is full open system interconnection: an Internet router must be able to interoperate robustly and effectively with any other router or Internet host, across diverse Internet paths. iconic behavior ๐
Sometimes implementors have designed for less ambitious goals ๐ LAN environments are usually way more benign than the Internet as a whole. LANs have low packet loss and delay and don't reorder packets. Some vendors have shipped implementations that are fine for a simple LAN but work badly for general interoperation, and they justify it as economical within the restricted LAN market. Honestly though, isolated LANs seldom stay isolated for long ๐ค They soon get connected to each other, then to organization-wide internets, and eventually to the global Internet system. In the end, neither the customer nor the vendor is served by incomplete or substandard routers.
The requirements in this document are designed for a full-function router. Fully compliant routers are meant to be usable in almost any part of the Internet ๐ฆ
3. LINK LAYER ๐
Although [INTRO:1] covers Link Layer standards (IP over various link layers, ARP, etc.), this document expects that Link-Layer material will be covered in a separate Link Layer Requirements document ๐ A Link-Layer Requirements document would apply to both hosts and routers. So this document won't obsolete the parts of [INTRO:1] that deal with link-layer issues ๐ซถ
3.1 INTRODUCTION ๐
Routers basically have the same Link Layer protocol requirements as other sorts of Internet systems. These are given in chapter 3 of Requirements for Internet Gateways [INTRO:1]. A router MUST comply with its requirements and SHOULD comply with its recommendations. Since some of the material in that document has gotten kinda dated, some additional requirements and explanations are included below โจ
DISCUSSION
It is expected that the Internet community will produce a Requirements for Internet Link Layer standard which will supersede both this chapter and the chapter entitled "INTERNET LAYER PROTOCOLS" in [INTRO:1] ๐
3.2 LINK/INTERNET LAYER INTERFACE ๐ง
This document doesn't try to specify the interface between the Link Layer and the upper layers. But note well that other parts of this document, particularly chapter 5, require various sorts of information to be passed across this layer boundary ๐
This section uses the following definitions:
- Source physical address
The source physical address is the Link Layer address of the host or router from which the packet was received.
- Destination physical address
The destination physical address is the Link Layer address to which the packet was sent.
The information that must pass from the Link Layer to the Internetwork Layer for each received packet is:
- The IP packet [5.2.2],
- The length of the data portion (i.e., not including the Link-Layer framing) of the Link Layer frame [5.2.2],
- The identity of the physical interface from which the IP packet was received [5.2.3], and
- The classification of the packet's destination physical address as a Link Layer unicast, broadcast, or multicast [4.3.2], [5.3.4].
In addition, the Link Layer also should provide:
- The source physical address.
The information that must pass from the Internetwork Layer to the Link Layer for each transmitted packet is:
- The IP packet [5.2.1]
- The length of the IP packet [5.2.1]
- The destination physical interface [5.2.1]
- The next hop IP address [5.2.1]
In addition, the Internetwork Layer also should provide:
- The Link Layer priority value [5.3.3.2]
The Link Layer must also notify the Internetwork Layer if the packet to be transmitted causes a Link Layer precedence-related error [5.3.3.3] ๐จ
3.3 SPECIFIC ISSUES ๐ธ
3.3.1 Trailer Encapsulation ๐ป
Routers that can connect to ten megabit Ethernets MAY be able to receive and forward Ethernet packets encapsulated using the trailer encapsulation described in [LINK:1]. However, a router SHOULD NOT originate trailer encapsulated packets. A router MUST NOT originate trailer encapsulated packets without first verifying, using the mechanism described in [INTRO:2], that the immediate destination of the packet is willing and able to accept trailer-encapsulated packets. A router SHOULD NOT agree (using these mechanisms) to accept trailer-encapsulated packets ๐ โโ๏ธ
3.3.2 Address Resolution Protocol - ARP ๐
Routers that implement ARP MUST be compliant and SHOULD be unconditionally compliant with the requirements in [INTRO:2].
The link layer MUST NOT report a Destination Unreachable error to IP solely because there is no ARP cache entry for a destination. It SHOULD queue up to a small number of datagrams briefly while performing the ARP request/reply sequence, and reply that the destination is unreachable to one of the queued datagrams only when this proves fruitless ๐ซ
A router MUST not believe any ARP reply that claims that the Link Layer address of another host or router is a broadcast or multicast address ๐ซ
3.3.3 Ethernet and 802.3 Coexistence ๐ค
Routers that can connect to ten megabit Ethernets MUST be compliant and SHOULD be unconditionally compliant with the Ethernet requirements of [INTRO:2] ๐
3.3.4 Maximum Transmission Unit - MTU ๐
The MTU of each logical interface MUST be configurable within the range of legal MTUs for the interface.
Many Link Layer protocols define a maximum frame size that may be sent. In those cases, a router MUST NOT allow an MTU to be set which would allow sending of frames larger than those allowed by the Link Layer protocol. However, a router SHOULD be willing to receive a packet as large as the maximum frame size even if that's larger than the MTU ๐ง
DISCUSSION
Note that this is a stricter requirement than imposed on hosts by [INTRO:2], which requires that the MTU of each physical interface be configurable.
If a network is using an MTU smaller than the maximum frame size for the Link Layer, a router may receive packets larger than the MTU from misconfigured and incompletely initialized hosts. The Robustness Principle indicates that the router should successfully receive these packets if possible ๐
3.3.5 Point-to-Point Protocol - PPP ๐ง
Contrary to [INTRO:1], the Internet does have a standard point to point line protocol: the Point-to-Point Protocol (PPP), defined in [LINK:2], [LINK:3], [LINK:4], and [LINK:5] โจ
A point to point interface is any interface that is designed to send data over a point to point line. Such interfaces include telephone, leased, dedicated or direct lines (either 2 or 4 wire), and may use point to point channels or virtual circuits of multiplexed interfaces such as ISDN. They normally use a standardized modem or bit serial interface (such as RS-232, RS-449 or V.35), using either synchronous or asynchronous clocking. Multiplexed interfaces often have special physical interfaces ๐
A general purpose serial interface uses the same physical media as a point to point line, but supports the use of link layer networks as well as point to point connectivity. Link layer networks (such as X.25 or Frame Relay) use an alternative IP link layer specification ๐
Routers that implement point to point or general purpose serial interfaces MUST IMPLEMENT PPP.
PPP MUST be supported on all general purpose serial interfaces on a router. The router MAY allow the line to be configured to use point to point line protocols other than PPP. Point to point interfaces SHOULD either default to using PPP when enabled or require configuration of the link layer protocol before being enabled. General purpose serial interfaces SHOULD require configuration of the link layer protocol before being enabled ๐
3.3.5.1 Introduction ๐ท
This section gives guidelines to router implementors so they can make sure they interoperate with other routers using PPP over either synchronous or asynchronous links ๐ซถ
It is critical that an implementor understands the semantics of the option negotiation mechanism. Options are a means for a local device to indicate to a remote peer what the local device will accept from the remote peer, not what it wishes to send. It's up to the remote peer to decide what's most convenient to send within the confines of the set of options that the local device has stated it can accept. So it's perfectly acceptable and normal for a remote peer to ACK all the options indicated in an LCP Configuration Request (CR), even if the remote peer doesn't support any of those options. Again, the options are simply a mechanism for either device to indicate to its peer what it will accept, not necessarily what it will send ๐งโโ๏ธ
3.3.5.2 Link Control Protocol (LCP) Options
okay so the PPP Link Control Protocol (LCP) has a whole buffet of options you can negotiate ๐ like address and control field compression, protocol field compression, the asynchronous character map, Maximum Receive Unit (MRU), Link Quality Monitoring (LQM), magic number (for loopback detection), Password Authentication Protocol (PAP), Challenge Handshake Authentication Protocol (CHAP), and the 32-bit Frame Check Sequence (FCS) ๐ and that's just the highlights, bestie.
A router MAY use address/control field compression on either synchronous or asynchronous links. A router MAY use protocol field compression on either synchronous or asynchronous links. A router that indicates that it can accept these compressions MUST be able to accept uncompressed PPP header information also. ๐ซถ
DISCUSSION
These options control the look of the PPP header ๐ Normally it's the address, the control field, and the protocol field. On a point to point line the address is 0xFF, which means "broadcast." The control field is 0x03, which means "Unnumbered Information." The Protocol Identifier is a two byte value that tells you what's in the data area of the frame. Now if a system negotiates address and control field compression, it's basically saying "hey, I'll accept PPP frames that have these fields at the front or don't." It is NOT saying it'll be sending frames with those fields removed. Lowkey important distinction ๐ง
Protocol field compression, when negotiated, means the system is willing to receive protocol fields squished down to one byte when that's legal. The sender doesn't have to do it though ๐ฆ
Using address/control field compression doesn't mix with numbered mode (reliable) PPP ๐
IMPLEMENTATION
Some hardware doesn't handle variable length header info very well ๐ So in those cases it makes the most sense for the remote peer to send the full PPP header. Implementations can make sure of that by not sending the address/control field and protocol field compression options to the remote peer. Even if the remote peer says it can receive compressed headers, the local router doesn't have to send compressed headers. Main character energy for the full header ๐
A router MUST negotiate the Asynchronous Control Character Map (ACCM) for asynchronous PPP links, but SHOULD NOT negotiate the ACCM for synchronous links. If a router gets an attempt to negotiate the ACCM over a synchronous link, it MUST ACKnowledge the option and then ignore it. โจ
DISCUSSION
Some implementations offer both synchronous and asynchronous modes and use the same code to negotiate the option ๐ So it's totally possible that one end or the other sends the ACCM option on a synchronous link. It's giving chaos, but it's expected chaos ๐ญ
A router SHOULD properly negotiate the maximum receive unit (MRU). Even if a system negotiates an MRU smaller than 1,500 bytes, it MUST be able to receive a 1,500 byte frame. ๐
A router SHOULD negotiate and enable the link quality monitoring (LQM) option. ๐ฅ
DISCUSSION
This memo doesn't set a policy for deciding whether a link's quality is good enough ๐คทโโ๏ธ But it IS important (see Section [3.3.6]) that a router disables failed links. Not me letting a dead link hang around ๐
A router SHOULD implement and negotiate the magic number option for loopback detection. ๐ช
A router MAY support the authentication options (PAP - Password Authentication Protocol, and/or CHAP - Challenge Handshake Authentication Protocol). ๐
A router MUST support 16-bit CRC frame check sequence (FCS) and MAY support the 32-bit CRC. ๐ซง
3.3.5.3 IP Control Protocol (IPCP) Options
A router MAY offer to do IP address negotiation. A router MUST accept a refusal (REJect) to do IP address negotiation from the peer. Respect the no, periodt ๐ โโ๏ธ๐
Routers running at link speeds of 19,200 BPS or less SHOULD implement and offer Van Jacobson header compression. Routers that implement VJ compression SHOULD implement an administrative control that turns it on or off. Give the admin the remote ๐๏ธโจ
3.3.6 Interface Testing
A router MUST have a mechanism that lets routing software figure out whether a physical interface is available to send packets or not. On multiplexed interfaces where permanent virtual circuits are opened for limited sets of neighbors, the router must also be able to determine whether the virtual circuits are viable. A router SHOULD have a mechanism that lets routing software judge the quality of a physical interface. A router MUST have a mechanism for telling the routing software when a physical interface becomes available or unavailable to send packets because of administrative action. A router MUST have a mechanism for telling the routing software when it detects a Link level interface has become available or unavailable, for any reason. ๐ก
DISCUSSION
It is crucial that routers have workable ways of checking that their network connections are actually working ๐จ Missing a link loss, or not taking the right action when a problem shows up, can lead to black holes ๐ณ๏ธ Scary stuff, bestie.
The ways to detect connection problems vary a LOT depending on the Link Layer protocols in use and the interface hardware ๐ซ The goal is to maximize the ability to catch failures within the Link-Layer constraints. Do your best with what you've got ๐ช
4. INTERNET LAYER - PROTOCOLS โจ
4.1 INTRODUCTION
This chapter and chapter 5 talk about the protocols used at the Internet Layer: IP, ICMP, and IGMP ๐ฆ Forwarding is obviously a huge deal in a doc about routers, so chapter 5 sticks to the parts of the protocols that directly relate to forwarding. This chapter has the rest of the Internet Layer protocol tea ๐ต
4.2 INTERNET PROTOCOL - IP
4.2.1 INTRODUCTION
Routers MUST implement the IP protocol, as defined by [INTERNET:1]. They MUST also implement its mandatory extensions: subnets (defined in [INTERNET:2]), IP broadcast (defined in [INTERNET:3]), and Classless Inter-Domain Routing (CIDR, defined in [INTERNET:15]). No skipping the required stuff, bestie ๐
Router implementors don't need to worry about complying with the section of [INTRO:2] called "Internet Protocol -- IP," because that whole section is entirely duplicated or superseded in this document โจ A router MUST be compliant, and SHOULD be unconditionally compliant, with the requirements in the section called "SPECIFIC ISSUES" that relate to IP in [INTRO:2]. Full compliance is the move ๐
Here's the deal with certain cases where the action is to silently discard a received datagram ๐คซ That means the datagram gets tossed without any further processing, and the router won't send any ICMP error message (see Section [4.3]) because of it. BUT for diagnosing problems, a router SHOULD provide the ability to log the error (see Section [1.3.3]), including the contents of the silently discarded datagram, and SHOULD count the datagrams it discards. Receipts for the drama, iykyk ๐๐
4.2.2 PROTOCOL WALK-THROUGH
RFC 791 [INTERNET:1] is the specification for the Internet Protocol. Go read it, it's the OG ๐ง๐
4.2.2.1 Options: RFC 791 Section 3.2 ๐
Okay bestie, let's talk IP options ๐ โจ In datagrams the router itself receives, the IP layer MUST interpret the IP options it understands and preserve the rest unchanged for use by higher layer protocols ๐ฆ.
Higher layer protocols might need to set IP options on the datagrams they send, or check the IP options on the ones they receive ๐ซถ. Later sections cover the specific IP option support that higher layer protocols need, so keep reading ๐.
DISCUSSION
Neither this memo nor [INTRO:2] define the order in which a receiver must process multiple options in the same IP header ๐. Hosts and routers that originate datagrams with multiple options need to know this creates an ambiguity in what certain options mean when they're combined with a source-route option ๐.
Here's the tea on specific IP options ๐:
(a) Security Option
Some environments need the Security option in every packet originated or received ๐. Routers SHOULD IMPLEMENT the revised security option described in [INTERNET:5] ๐ฅ.
DISCUSSION
Note that the security options described in [INTERNET:1] and RFC 1038 ([INTERNET:16]) are obsolete ๐ฅ.
(b) Stream Identifier Option
This option is obsolete. Routers SHOULD NOT place this option in a datagram that the router originates ๐ โโ๏ธ. This option MUST be ignored in datagrams received by the router ๐ค.
(c) Source Route Options
A router MUST be able to act as the final destination of a source route ๐ฏ. If a router receives a packet with a completed source route, the packet has reached its final destination ๐. In that kind of option, the pointer points beyond the last field, and the destination address in the IP header addresses the router. The option as received (the recorded route) MUST be passed up to the transport layer (or to ICMP message processing) ๐ฌ.
In the general case, a correct response to a source-routed datagram traverses the same route ๐ค๏ธ. A router MUST provide a means whereby transport protocols and applications can reverse the source route in a received datagram ๐. This reversed source route MUST be inserted into datagrams they originate (see [INTRO:2] for details) when the router is unaware of policy constraints. However, if the router is policy aware, it MAY select another path ๐บ๏ธ.
Some applications in the router MAY require that the user be able to enter a source route โจ๏ธ.
A router MUST NOT originate a datagram containing multiple source route options ๐ซ. What a router should do if asked to forward a packet containing multiple source route options is described in Section [5.2.4.1] ๐.
When a source route option is created (which would happen when the router is originating a source routed datagram, or is inserting a source route option as a result of a special filter), it MUST be correctly formed, even if it is being created by reversing a recorded route that erroneously includes the source host (see case (B) in the discussion below) ๐งฉ.
DISCUSSION
Suppose a source routed datagram is to be routed from source _S_ to destination D via routers G1, G2, Gn. Source S constructs a datagram with G1's IP address as its destination address, plus a source route option to get the datagram the rest of the way to its destination. But there's an ambiguity in the specification over whether the source route option in a datagram sent out by S should be (A) or (B) ๐ค:
(A): {>>G2, G3, ... Gn, D} <--- CORRECT
(B): {S, >>G2, G3, ... Gn, D} <---- WRONG
(where >> represents the pointer). If (A) is sent, the datagram received at D will contain the option {G1, G2, ... Gn >>}, with S and D as the IP source and destination addresses ๐ฆ. If (B) were sent, the datagram received at D would again contain S and D as the same IP source and destination addresses, but the option would be {S, G1, ...Gn >>}. In other words, the originating host would be the first hop in the route ๐ฑ.
(d) Record Route Option
Routers MAY support the Record Route option in datagrams originated by the router ๐.
(e) Timestamp Option
Routers MAY support the timestamp option in datagrams originated by the router โฐ. The following rules apply:
- When originating a datagram containing a Timestamp Option, a router MUST record a timestamp in the option if
- Its Internet address fields are not pre-specified, or
- Its first pre-specified address is the IP address of the logical interface over which the datagram is being sent (or the router's router-id if the datagram is being sent over an unnumbered interface).
- If the router itself receives a datagram containing a Timestamp Option, the router MUST insert the current time into the Timestamp Option (if there is space in the option to do so) before passing the option to the transport layer or to ICMP for processing. If space is not present, the router MUST increment the Overflow Count in the option โ.
- A timestamp value MUST follow the rules defined in
[INTRO:2]๐ฐ๏ธ.
IMPLEMENTATION
To maximize the utility of the timestamps in the timestamp option, the timestamp inserted should be, as nearly as practical, the time at which the packet arrived at the router ๐ฏ. For datagrams originated by the router, the timestamp inserted should be, as nearly as practical, the time at which the datagram was passed to the Link Layer for transmission ๐.
The timestamp option permits the use of a non-standard time clock, but a non-synchronized clock limits the utility of the time stamp ๐ฌ. Therefore, routers are well advised to implement the Network Time Protocol to synchronize their clocks โฑ๏ธโจ.
4.2.2.2 Addresses in Options: RFC 791 Section 3.1 ๐
Routers are called upon to insert their address into Record Route, Strict Source and Record Route, Loose Source and Record Route, or Timestamp Options ๐. When a router inserts its address into such an option, it MUST use the IP address of the logical interface on which the packet is being sent ๐ชช. Where this rule can't be obeyed because the output interface has no IP address (i.e., it's an unnumbered interface), the router MUST instead insert its router-id ๐. The router's router-id is one of the router's IP addresses. The Router ID may be specified on a system basis or on a per-link basis ๐.
Which of the router's addresses is used as the router-id MUST NOT change (even across reboots) unless the network manager changes it. Relevant management changes include reconfiguring the router so the IP address used as the router-id stops being one of the router's IP addresses ๐ ๏ธ. Routers with multiple unnumbered interfaces MAY have multiple router-id's. Each unnumbered interface MUST be associated with a particular router-id. This association MUST NOT change (even across reboots) without reconfiguration of the router ๐.
DISCUSSION
This specification doesn't allow for routers that don't have at least one IP address ๐ . We don't view this as a serious limitation, since a router needs an IP address to meet the manageability requirements of Chapter [8], even if the router is connected only to point-to-point links ๐งโ๐ป.
IMPLEMENTATION
One possible method of choosing the router-id that fulfills this requirement is to use the numerically smallest (or greatest) IP address (treating the address as a 32-bit integer) assigned to the router ๐ข.
4.2.2.3 Unused IP Header Bits: RFC 791 Section 3.1 ๐ซง
The IP header has two reserved bits: one in the Type of Service byte and the other in the Flags field ๐ง. A router MUST NOT set either of these bits to one in datagrams originated by the router ๐ท. A router MUST NOT drop (refuse to receive or forward) a packet merely because one or more of these reserved bits has a non-zero value. In other words, the router MUST NOT check the values of these bits ๐.
DISCUSSION
Future revisions to the IP protocol may make use of these unused bits ๐ฎ. These rules are meant to make sure those revisions can be deployed without having to upgrade all routers on the Internet at the same time ๐.
4.2.2.4 Type of Service: RFC 791 Section 3.1 ๐
The Type-of-Service byte in the IP header is split into three sections: the Precedence field (high-order 3 bits), a field customarily called Type of Service or TOS (next 4 bits), and a reserved bit (the low-order bit) ๐ฐ.
Rules for the reserved bit were described in Section [4.2.2.3] ๐.
A more extensive discussion of the TOS field and how it's used can be found in [ROUTE:11] ๐.
The description of the IP Precedence field is superseded by Section [5.3.3] ๐ช. RFC 795, Service Mappings, is obsolete and SHOULD NOT be implemented ๐ซ.
4.2.2.5 Header Checksum: RFC 791 Section 3.1 โ
As stated in Section [5.2.2], a router MUST verify the IP checksum of any packet it receives, and MUST discard messages containing invalid checksums ๐ต๏ธโโ๏ธ. The router MUST NOT provide a means to disable this checksum verification ๐.
A router MAY use incremental IP header checksum updating when the only change to the IP header is the time to live ๐. This reduces the chance of undetected corruption of the IP header by the router ๐ก๏ธ. See [INTERNET:6] for a discussion of incrementally updating the checksum ๐.
IMPLEMENTATION
A more extensive description of the IP checksum, including lots of implementation hints, can be found in [INTERNET:6] and [INTERNET:7] ๐ก.
4.2.2.6 Unrecognized Header Options: RFC 791 Section 3.1 ๐ง
A router MUST ignore IP options it does not recognize ๐. A corollary of this requirement is that a router MUST implement the End of Option List option and the No Operation option, since neither one contains an explicit length ๐.
DISCUSSION
All future IP options will include an explicit length ๐.
4.2.2.7 Fragmentation: RFC 791 Section 3.2 ๐งฉ
okay bestie, fragmentation time ๐ Routers MUST support it, the way it's described in [INTERNET:1]. No skipping this one ๐ โโ๏ธ
When a router fragments a datagram, it SHOULD keep the number of fragments as low as it can. It SHOULD also send those fragments in order. A fragmentation method that might produce one fragment that's way smaller than the rest MAY end up putting that tiny one first ๐ฆ
DISCUSSION ๐ฌ
Lots of fragmentation techniques are in use across the Internet, and this is giving main character energy ๐ One way is to chop the datagram into fragments where the first one is MTU sized and the rest are roughly equal and smaller than the MTU. The first fragment shows the effective MTU of the path between the hosts, and the later ones are sized so they don't get fragmented again. Another way is to cut the datagram into MTU sized fragments, where only the last one is smaller, as described in [INTERNET:1] ๐ธ
Some TCP/IP implementations have a sneaky trick where they fragment into pieces no bigger than 576 bytes when the datagram is going through a router. The idea is that those pieces will get through the rest of the path without being fragmented again. Honestly, though, that puts more work on the destination host, since it has to reassemble way more fragments into one datagram ๐ญ It's also not efficient on networks where the MTU only changes once and then stays much bigger than 576 bytes. Think LAN networks, like an IEEE 802.5 network with an MTU of 2048 or an Ethernet network with an MTU of 1500).
Another technique that got discussed was splitting the datagram into roughly equal fragments, each less than or equal to the next hop network's MTU. This helps cut down on how many fragments show up from more fragmentation further down the path, and it makes sure each fragment has about the same delay โฑ๏ธ
Routers SHOULD generate the least possible number of IP fragments ๐
Work with slow machines suggests that if you do have to fragment, sending the small fragment first gives a host with a slow interface the best shot at receiving all the fragments ๐ขโจ
4.2.2.8 Reassembly: RFC 791 Section 3.2 ๐งท
As specified in the matching section of [INTRO:2], a router MUST support reassembly of datagrams that it delivers to itself ๐
4.2.2.9 Time to Live: RFC 791 Section 3.2 โณ
Time to Live (TTL) handling for packets that the router originates or receives is governed by [INTRO:2]. This section doesn't change any of those rules. But since the rest of the IP Protocol section of [INTRO:2] is rewritten, this section gets rewritten too ๐
Note in particular that a router MUST NOT check the TTL of a packet except when forwarding it ๐
A router MUST NOT originate or forward a datagram with a Time-to-Live (TTL) value of zero ๐ โโ๏ธ
A router MUST NOT discard a datagram just because it arrived with TTL equal to zero or one. If it's addressed to the router and otherwise valid, the router MUST attempt to receive it ๐ซถ
For messages the router originates, the IP layer MUST provide a way for the transport layer to set the TTL field of every datagram that gets sent. When a fixed TTL value is used, it MUST be configurable. The number SHOULD exceed the typical internet diameter, and current wisdom says it should go beyond twice the internet diameter to leave room for growth. Current suggested values are normally posted in the Assigned Numbers RFC ๐ The TTL field does two jobs: it limits how long TCP segments can live (see RFC 793 [TCP:1], p. 28), and it ends Internet routing loops ๐ TTL is measured in seconds, but it also acts a bit like a hop count, since each router is required to reduce the TTL field by at least one ๐งฎ
TTL expiration is meant to get datagrams discarded by routers, not by the destination host. So hosts that act as routers by forwarding datagrams must follow the router's rules for TTL too ๐ง
A higher-layer protocol might want to set the TTL to run an "expanding scope" search for some Internet resource. Some diagnostic tools do this, and it's expected to be handy for finding the "nearest" server of a given class using IP multicasting, for example ๐ A particular transport protocol may also want to set its own TTL bound on maximum datagram lifetime ๐
A fixed default value must be at least big enough to cover the Internet "diameter," meaning the longest possible path. A reasonable value is about twice the diameter, so there's room for the Internet to keep growing ๐ As of this writing, messages crossing the United States often go through 15 to 20 routers. That means a default TTL value above 40 makes sense, and 64 is a common value ๐
4.2.2.10 Multi-subnet Broadcasts: RFC 922 ๐ก
All-subnets broadcasts (called multi-subnet broadcasts in [INTERNET:3]) have been deprecated. See Section [5.3.5.3] ๐
4.2.2.11 Addressing: RFC 791 Section 3.2 ๐
As noted in 2.2.5.1, there are now five classes of IP addresses: Class A through Class E. Class D addresses are used for IP multicasting [INTERNET:4], and Class E addresses are reserved for experimental use ๐งช The difference between Class A, B, and C addresses doesn't matter anymore. They're used as generalized unicast network prefixes and only have historical interest in their class ๐ฐ๏ธ
An IP multicast address is a 28-bit logical address that stands for a group of hosts. It can be permanent or transient. Permanent multicast addresses are allocated by the Internet Assigned Number Authority [INTRO:7], while transient addresses may be allocated dynamically to transient groups. Group membership is figured out dynamically using IGMP [INTERNET:4] ๐ซง
Here are the important special cases for general purpose unicast IP addresses, using this notation for an IP address: { <Network-prefix>, <Host-number> }. The notation -1 means a field with all 1 bits, and 0 means a field with all 0 bits ๐ข
(a) { 0, 0 }
This host on this network. It MUST NOT be used as a source address by routers, except that the router MAY use it as a source address during an initialization procedure (for example, if the router is using BOOTP to load its configuration information) ๐ฅบ
Incoming datagrams with a source address of { 0, 0 } that are received for local delivery (see Section [5.2.3]) MUST be accepted if the router implements the associated protocol and that protocol clearly defines the right action to take. Otherwise, a router MUST silently discard any locally-delivered datagram whose source address is { 0, 0 } ๐คซ
DISCUSSION ๐ฌ
Some protocols define specific actions for a received datagram whose source address is { 0, 0 }. BOOTP and ICMP Mask Request are two examples. These protocols often depend on being able to receive datagrams with a source address of { 0, 0 }. For most protocols, though, it's best to ignore datagrams with a source address of { 0, 0 }, since they were probably made by a misconfigured host or router ๐ So if a router knows how to handle a given datagram with a { 0, 0 } source address, the router MUST accept it. Otherwise, the router MUST discard it.
See also Section [4.2.3.1] for a non-standard use of { 0, 0 } ๐ง
(b) { 0, <Host-number> }
Specified host on this network. It MUST NOT be sent by routers, except that the router MAY use this as a source address during an initialization procedure by which the it learns its own IP address ๐ช
(c) { -1, -1 }
Limited broadcast. It MUST NOT be used as a source address.
A datagram with this destination address will be received by every host and router on the connected physical network, but it won't be forwarded outside that network ๐ฃ
(d) { <Network-prefix>, -1 }
Directed Broadcast, which is a broadcast aimed at the specified network prefix. It MUST NOT be used as a source address. A router MAY originate Network Directed Broadcast packets. A router MUST receive Network Directed Broadcast packets. However, a router MAY have a configuration option to stop these packets from being received, and such an option MUST default to allowing reception ๐ฏ
(e) { 127, <any> }
Internal host loopback address. Addresses of this form MUST NOT appear outside a host ๐
The <Network-prefix> is assigned administratively so that its value is unique within the routing domain the device is connected to ๐บ๏ธ
IP addresses are not allowed to have the value 0 or -1 in the <Host-number> or <Network-prefix> fields, except in the special cases listed above. That means each of these fields will be at least two bits long ๐
DISCUSSION ๐ฌ
Earlier versions of this document also said that subnet numbers must be neither 0 nor -1, and must be at least two bits in length. In a CIDR world, though, the subnet number is clearly part of the network prefix and can't be interpreted without the rest of the prefix. So that restriction on subnet numbers is meaningless now and may be safely ignored ๐ง
For more on broadcast addresses, see Section [4.2.3.1] ๐
When a router originates any datagram, the IP source address MUST be one of its own IP addresses (but not a broadcast or multicast address). The only exception is during initialization ๐ ๏ธ
For most purposes, a datagram addressed to a broadcast or multicast destination gets processed as if it were addressed to one of the router's IP addresses. In other words:
- A router MUST receive and process normally any packets with a broadcast destination address.
- A router MUST receive and process normally any packets sent to a multicast destination address that the router has asked to receive.
The term specific-destination address means the equivalent local IP address of the host. The specific-destination address is the destination address in the IP header, unless the header contains a broadcast or multicast address. In that case, the specific-destination is an IP address assigned to the physical interface the datagram arrived on ๐ฌ
A router MUST silently discard any received datagram that has an IP source address that's invalid under the rules of this section. This validation could be done by the IP layer or, when it makes sense, by each protocol in the transport layer. Just like with any datagram a router discards, the datagram discard SHOULD be counted ๐งพ
DISCUSSION ๐ฌ
A misaddressed datagram might come from a Link Layer broadcast of a unicast datagram, or from another router or host that's confused or misconfigured ๐ตโ๐ซ
4.2.3 SPECIFIC ISSUES ๐
4.2.3.1 IP Broadcast Addresses ๐ก
okay so, for historical reasons ๐ฐ๏ธ there are a bunch of IP addresses (some standard, some not ๐) that mean "this packet is a broadcast." a router:
- MUST treat packets addressed to
255.255.255.255or{ <Network-prefix>, -1 }as IP broadcasts. ๐ข - SHOULD silently discard (aka don't even deliver them to applications inside the router ๐) any packet addressed to
0.0.0.0or{ <Network-prefix>, 0 }. if these packets are not silently discarded, they MUST be treated as IP broadcasts (see Section [5.3.5]). there MAY be a configuration option to allow receipt of these packets. that option SHOULD default to discarding them. ๐๏ธโจ - SHOULD (by default) use the limited broadcast address (
255.255.255.255) when originating an IP broadcast destined for a connected (sub)network. the exception is when sending an ICMP Address Mask Reply, as discussed in Section [4.3.3.9]. a router MUST receive limited broadcasts. ๐ - SHOULD NOT originate datagrams addressed to
0.0.0.0or{ <Network-prefix>, 0 }. there MAY be a configuration option to allow generation of these packets (instead of using the relevant 1s format broadcast). that option SHOULD default to not generating them. ๐ซถ
Discussion ๐ง in the second bullet, the router literally cannot recognize addresses of the form { <Network-prefix>, 0 } if it has no interface to that network prefix. so in that case the second bullet's rules don't apply, because from the router's point of view the packet isn't an IP broadcast packet at all. ngl that's giving logic ๐
4.2.3.2 IP Multicasting ๐
an IP router SHOULD satisfy the Host Requirements when it comes to IP multicasting, as specified in [INTRO:2]. an IP router SHOULD support local IP multicasting on all connected networks. when a mapping from IP multicast addresses to link-layer addresses has been specified (see the various IP-over-xxx specifications), it SHOULD use that mapping, and it MAY be configurable to use the link layer broadcast instead. on point-to-point links and all other interfaces, multicasts are encapsulated as link layer broadcasts. ๐ฆ
local IP multicasting support covers originating multicast datagrams, joining multicast groups, receiving multicast datagrams, and leaving multicast groups. that implies support for all of [INTERNET:4], including IGMP (see Section [4.4]). it's a whole package ๐
Discussion ๐ธ [INTERNET:4] is titled Host Extensions for IP Multicasting, but it applies to all IP systems, both hosts and routers. since routers can join multicast groups, it's totally correct for them to do the host part of IGMP, reporting their group memberships to any multicast routers on their attached networks (whether or not they're multicast routers themselves). the way that's so logical ๐ญ
some router protocols may specifically require IP multicasting support (e.g., OSPF [ROUTE:1]), or may just recommend it (e.g., ICMP Router Discovery [INTERNET:13]). ๐ง
4.2.3.3 Path MTU Discovery ๐ฃ๏ธ
to eliminate fragmentation (or at least minimize it), it's desirable to know the path MTU along the path from source to destination. the path MTU is the minimum of the MTUs of each hop in the path. [INTERNET:14] describes a technique for dynamically discovering the maximum transmission unit (MTU) of an arbitrary internet path. for a path that goes through a router that does not support [INTERNET:14], that technique might not discover the correct Path MTU. but it will always choose a Path MTU as accurate as, and in many cases more accurate than, the one chosen by older techniques or current practice. the glow up is real โจ
when a router is originating an IP datagram, it SHOULD use the scheme described in [INTERNET:14] to limit the datagram's size. if the router's route to the datagram's destination was learned from a routing protocol that provides Path MTU information, the scheme described in [INTERNET:14] is still used. but the Path MTU information from the routing protocol SHOULD be used as the initial guess for the Path MTU, and also as an upper bound on it. ๐
4.2.3.4 Subnetting ๐
sometimes it might be useful to have subnets of a particular network interconnected only through a path that is not part of the subnetted network. that's called discontiguous subnetwork support, and it's iconic ๐
routers MUST support discontiguous subnetworks. no exceptions bestie ๐ซถ
Implementation ๐ง in classical IP networks this was super hard to pull off. in CIDR networks it's a natural by-product ๐. so a router SHOULD NOT make assumptions about subnet architecture, and it SHOULD treat each route as a generalized network prefix. ๐
Discussion ๐ญ the Internet has been growing at a tremendous rate lately, and that's putting severe strain on IP addressing technology. a big part of the strain is the strict IP Address class boundaries. they make it hard to size network prefixes efficiently to their networks, and hard to aggregate several network prefixes into one route advertisement. ๐ฉ by getting rid of the strict class boundaries and treating each route as a generalized network prefix, those strains can be greatly reduced. the technology doing this right now is Classless Inter Domain Routing (CIDR) [INTERNET:15]. ๐
for similar reasons, an address block with a given network prefix can be split into subblocks of different sizes, so the network prefixes of the subblocks end up with different lengths. for example, inside a block whose network prefix is 8 bits long, one subblock might have a 16 bit network prefix, another an 18 bit network prefix, and a third a 14 bit network prefix. it's giving mix and match ๐งฉ
routers MUST support variable length network prefixes in both their interface configurations and their routing databases. ๐ฅ
4.3 INTERNET CONTROL MESSAGE PROTOCOL - ICMP ๐ซง
4.3.1 INTRODUCTION ๐
ICMP is an auxiliary protocol. it provides routing, diagnostic, and error functionality for IP, and it's described in [INTERNET:8]. a router MUST support ICMP. no skipping this one ๐ โโ๏ธ
ICMP messages come in two classes, which the following sections dig into:
ICMP error messages:
Destination Unreachable Section 4.3.3.1
Redirect Section 4.3.3.2
Source Quench Section 4.3.3.3
Time Exceeded Section 4.3.3.4
Parameter Problem Section 4.3.3.5
ICMP query messages:
Echo Section 4.3.3.6
Information Section 4.3.3.7
Timestamp Section 4.3.3.8
Address Mask Section 4.3.3.9
Router Discovery Section 4.3.3.10
the general ICMP requirements and discussion are in the next section ๐
4.3.2 GENERAL ISSUES ๐ท
4.3.2.1 Unknown Message Types ๐ธ
if an ICMP message of an unknown type is received, it MUST be passed to the ICMP user interface (if the router has one), or silently discarded (if the router doesn't have one). ๐๏ธ
4.3.2.2 ICMP Message TTL โณ
when originating an ICMP message, the router MUST initialize the TTL. the TTL for ICMP responses must not be taken from the packet that triggered the response. don't copy the homework ๐๐ โโ๏ธ
4.3.2.3 Original Message Header ๐ฆ
historically, every ICMP error message included the Internet header and at least the first 8 data bytes of the datagram that triggered the error. that's no longer adequate, because of IP-in-IP tunneling and other technologies. so the ICMP datagram SHOULD contain as much of the original datagram as possible, without the ICMP datagram's length exceeding 576 bytes. ๐
the returned IP header (and user data) MUST be identical to what was received. the exception is that the router isn't required to undo any modifications to the IP header that are normally made while forwarding, which were made before the error was detected (e.g., decrementing the TTL, or updating options). ๐
note that the requirements of Section [4.3.3.5] supersede this requirement in some cases. for a Parameter Problem message, if the problem is in a modified field, the router must undo the modification. see Section [4.3.3.5]). โ ๏ธ
4.3.2.4 ICMP Message Source Address ๐
unless this document says otherwise, the IP source address in an ICMP message originated by the router MUST be one of the IP addresses associated with the physical interface the ICMP message is transmitted over. if that interface has no IP addresses associated with it, the router's router-id (see Section [5.2.5]) is used instead. ๐
4.3.2.5 TOS and Precedence ๐ โจ
ICMP error messages SHOULD have their TOS bits set to the same value as the TOS bits in the packet that provoked the error message. the exception is if setting them that way would make the ICMP error message get immediately discarded because it couldn't be routed to its destination. otherwise, ICMP error messages MUST be sent with a normal (i.e., zero) TOS. an ICMP reply message SHOULD have its TOS bits set to the same value as the TOS bits in the ICMP request that provoked it. ๐
ICMP Source Quench error messages, if sent at all, MUST have their IP Precedence field set to the same value as the IP Precedence field in the packet that provoked the Source Quench. every other ICMP error message (Destination Unreachable, Redirect, Time Exceeded, and Parameter Problem) SHOULD have its precedence value set to 6 (INTERNETWORK CONTROL) or 7 (NETWORK CONTROL). the IP Precedence value for these error messages MAY be settable. ๐ง
an ICMP reply message MUST have its IP Precedence field set to the same value as the IP Precedence field in the ICMP request that provoked it. ๐
4.3.2.6 Source Route ๐บ๏ธ
if the packet that provokes an ICMP error message contains a source route option, the ICMP error message SHOULD also contain a source route option of the same type (strict or loose). it gets created by reversing the portion before the pointer of the route recorded in the original packet's source route option. the exceptions are when the ICMP error message is an ICMP Parameter Problem complaining about a source route option in the original packet, or when the router is aware of policy that would prevent delivery of the ICMP error message. ๐งญ
Discussion ๐ต๏ธโโ๏ธ in environments that use the U.S. Department of Defense security option (defined in [INTERNET:5]), ICMP messages may need to include a security option. detailed info on this topic should be available from the Defense Communications Agency. the government has the receipts ๐๐
4.3.2.7 When Not to Send ICMP Errors ๐
Okay so, an ICMP error message MUST NOT be sent just because a router or host received any of the following:
- An ICMP error message, or
- A packet that fails the IP header validation tests described in Section [5.2.2] (except where that section specifically permits the sending of an ICMP error message), or
- A packet destined to an IP broadcast or IP multicast address, or
- A packet sent as a Link Layer broadcast or multicast, or
- A packet whose source address has a network prefix of zero or is an invalid source address (as defined in Section [5.3.7]), or
- Any fragment of a datagram other than the first fragment (i.e., a packet for which the fragment offset in the IP header is nonzero).
And also, an ICMP error message MUST NOT be sent in any case where this memo says a packet is to be silently discarded. Shush, no error for you ๐คซ
NOTE: THESE RESTRICTIONS TAKE PRECEDENCE OVER ANY REQUIREMENT ELSEWHERE IN THIS DOCUMENT FOR SENDING ICMP ERROR MESSAGES. ๐ซ๐
DISCUSSION
These rules exist to stop broadcast storms ๐ช๏ธ. Those happened when routers or hosts kept replying with ICMP errors to broadcast packets. Picture a broadcast UDP packet aimed at a port nobody is listening on. Every device without a client for that port could fire back a flood of ICMP Destination Unreachable datagrams ๐ญ. On a big Ethernet, the collisions can wreck the network for a second or more. Literally chaos.
Every packet that gets broadcast on the connected network should have a valid IP broadcast address as its IP destination (see Section [5.3.4] and [INTRO:2]). Some devices don't follow this rule though, so to be sure we catch every broadcast, routers are required to check for a link-layer broadcast as well as an IP-layer address. Double-checking is giving main character energy โจ
IMPLEMENTATION+
This requires the link layer to tell the IP layer when a link-layer broadcast packet has been received. See Section [3.1] ๐ง
4.3.2.8 Rate Limiting ๐ฆ
A router that sends ICMP Source Quench messages MUST be able to limit how fast it generates them. A router SHOULD also be able to limit how fast it sends other kinds of ICMP error messages (Destination Unreachable, Redirect, Time Exceeded, Parameter Problem). The rate limit parameters SHOULD be settable as part of the router's configuration. How the limits get applied (for example, per router or per interface) is left up to the implementor ๐
DISCUSSION
There are two problems when a router sends ICMP error messages ๐ฉ:
- The consumption of bandwidth on the reverse path, and
- The use of router resources (e.g., memory, CPU time)
To help with both, a router can limit how often it generates ICMP error messages. For similar reasons, a router may also limit how often it generates some other kinds of messages, like ICMP Echo Replies. Pacing yourself is a whole vibe ๐ธ
IMPLEMENTATION
People have used or proposed a few different mechanisms for limiting how fast ICMP messages go out:
- Count-based: for example, send an ICMP error message for every N dropped packets overall, or per given source host. This might suit ICMP Source Quench, if it's used, but probably not the other types of ICMP messages.
- Timer-based: for example, send an ICMP error message to a given source host, or overall, at most once per T milliseconds. โฐ
- Bandwidth-based: for example, limit how fast ICMP messages are sent over a particular interface to some fraction of the attached network's bandwidth. ๐
4.3.3 SPECIFIC ISSUES ๐
4.3.3.1 Destination Unreachable ๐ง
If a router can't forward a packet because it has no routes at all (including no default route) to the destination in the packet, then the router MUST generate a Destination Unreachable, Code 0 (Network Unreachable) ICMP message. If the router does have routes to the destination network, but the TOS on those routes is neither the default TOS (0000) nor the TOS of the packet the router is trying to route, then the router MUST generate a Destination Unreachable, Code 11 (Network Unreachable for TOS) ICMP message. ๐
If a packet is headed to a host on a network directly connected to the router (so the router is the last-hop router), and the router has figured out there's no path to that host, then the router MUST generate a Destination Unreachable, Code 1 (Host Unreachable) ICMP message. And if a packet is headed to a host on a directly connected network, and the router can't forward it because no route to the destination has a TOS that either matches the TOS requested in the packet or is the default TOS (0000), then the router MUST generate a Destination Unreachable, Code 12 (Host Unreachable for TOS) ICMP message. ๐
DISCUSSION
The idea is that a router sends the "generic" host or network unreachable message when it has no path at all to the destination (default routes included). If it has one or more paths but none of them have an acceptable TOS, it sends the "unreachable for TOS" message instead. Each message tells you exactly what went wrong, which is honestly iconic ๐
4.3.3.2 Redirect ๐งญ
The ICMP Redirect message gets generated to tell a local host that it should use a different next hop router for certain traffic.
Contrary to [INTRO:2], a router MAY ignore ICMP Redirects when choosing a path for a packet the router itself originated, if the router is running a routing protocol, or if forwarding is enabled on the router and on the interface the packet is being sent over. Rules have exceptions, bestie ๐คทโโ๏ธ
4.3.3.3 Source Quench ๐ซง
A router SHOULD NOT originate ICMP Source Quench messages. As specified in Section [4.3.2], a router that does originate Source Quench messages MUST be able to limit how fast they're generated. ๐ โโ๏ธ
DISCUSSION
Research seems to suggest that Source Quench eats up network bandwidth but is a pretty ineffective (and unfair) way to deal with congestion ๐ค. See, for example, [INTERNET:9] and [INTERNET:10]. Section [5.3.6] covers the current thinking on how routers should handle overload and network congestion.
A router MAY ignore any ICMP Source Quench messages it receives. ๐
DISCUSSION
A router can itself receive a Source Quench because of a packet it originated and sent to another router or host. Those datagrams could be, for example, an EGP update sent to another router, or a telnet stream sent to a host. A mechanism has been proposed ([INTERNET:11], [INTERNET:12]) to make the IP layer respond directly to Source Quench by controlling the rate at which packets are sent. However, this proposal is still experimental and not currently recommended, so hold off on that one ๐งช
4.3.3.4 Time Exceeded โณ
When a router is forwarding a packet and the TTL field of the packet gets reduced to 0, the requirements of section [5.2.3.8] apply. ๐ซ
When the router is reassembling a packet destined for the router, it's acting as an Internet host. So [INTRO:2]'s reassembly requirements apply. ๐งฉ
When the router receives a Time Exceeded message (i.e., one destined for the router), it MUST comply with [INTRO:2]. ๐
4.3.3.5 Parameter Problem ๐ ๏ธ
A router MUST generate a Parameter Problem message for any error that isn't specifically covered by another ICMP message. The IP header field or IP option that includes the byte indicated by the pointer field MUST be included unchanged in the IP header returned with this ICMP message. Section [4.3.2] defines an exception to this requirement, so keep that in mind ๐
A new variant of the Parameter Problem message was defined in [INTRO:2]:
Code 1 = required option is missing.
DISCUSSION
This variant is currently in use in the military community for a missing security option. Very serious stuff ๐ก๏ธ
4.3.3.6 Echo Request/Reply ๐
A router MUST implement an ICMP Echo server function that receives Echo Requests sent to the router and sends back corresponding Echo Replies. A router MUST be prepared to receive, reassemble and echo an ICMP Echo Request datagram at least as large as the maximum of 576 and the MTUs of all the connected networks. ๐ฆ
The Echo server function MAY choose not to respond to ICMP echo requests addressed to IP broadcast or IP multicast addresses.
A router SHOULD have a configuration option that, if enabled, makes the router silently ignore all ICMP echo requests. If that option is provided, it MUST default to allowing responses. ๐
DISCUSSION
The neutral stance on responding to broadcast and multicast Echo Requests comes from the "Echo Request/Reply" section of [INTRO:2]. Nice and balanced โ๏ธ
As stated in Section [10.3.3], a router MUST also implement a user/application-layer interface for sending an Echo Request and receiving an Echo Reply, for diagnostic purposes. All ICMP Echo Reply messages MUST be passed to this interface. ๐ฉบ
The IP source address in an ICMP Echo Reply MUST be the same as the specific-destination address of the corresponding ICMP Echo Request message. ๐ฏ
Data received in an ICMP Echo Request MUST be entirely included in the resulting Echo Reply. Nothing gets left behind ๐ซถ
If a Record Route and/or Timestamp option is received in an ICMP Echo Request, that option (or those options) SHOULD be updated to include the current router, and included in the IP header of the Echo Reply message without truncation. That way the recorded route covers the entire round trip. The full journey, no cap ๐บ๏ธ
If a Source Route option is received in an ICMP Echo Request, the return route MUST be reversed and used as a Source Route option for the Echo Reply message, unless the router is aware of policy that would prevent delivery of the message. โฉ๏ธ
4.3.3.7 Information Request/Reply ๐ซฅ
A router SHOULD NOT originate or respond to these messages. ๐ซ
DISCUSSION
The Information Request/Reply pair was meant to support self-configuring systems like diskless workstations, so they could find out their IP network prefixes at boot time. These messages are now obsolete though, and RARP and BOOTP are better options for a host to discover its own IP address. Ancient history, bestie ๐ฆโจ
4.3.3.8 Timestamp and Timestamp Reply โฐโจ
okay so a router MAY implement Timestamp and Timestamp Reply ๐ฐ๏ธ and if it does, these are the rules bestie needs to know:
- The ICMP Timestamp server function MUST return a Timestamp Reply to every Timestamp message that is received. It SHOULD be designed for minimum variability in delay ๐
- An ICMP Timestamp Request message to an IP broadcast or IP multicast address MAY be silently discarded ๐
- The IP source address in an ICMP Timestamp Reply MUST be the same as the specific-destination address of the corresponding Timestamp Request message ๐
- If a Source Route option is received in an ICMP Timestamp Request, the return route MUST be reversed and used as a Source Route option for the Timestamp Reply message, unless the router is aware of policy that would prevent the delivery of the message ๐ฆ
- If a Record Route and/or Timestamp option is received in a Timestamp Request, this (these) option(s) SHOULD be updated to include the current router and included in the IP header of the Timestamp Reply message ๐ธ
- If the router provides an application-layer interface for sending Timestamp Request messages, then incoming Timestamp Reply messages MUST be passed up to the ICMP user interface ๐ง
the preferred form for a timestamp value (the standard value) is milliseconds since midnight, Universal Time โณ. but ngl, it may be difficult to provide that with millisecond resolution ๐ญ. like, many systems use clocks that only update at line frequency, 50 or 60 times per second. so some latitude is allowed in a standard value, and it's giving flexible ๐:
(a) A standard value MUST be updated at least 16 times per second (i.e., at most the six low-order bits of the value may be undefined).
(b) The accuracy of a standard value MUST approximate that of operator-set CPU clocks, i.e., correct within a few minutes.
IMPLEMENTATION ๐ ๏ธ
to meet the second condition, a router may need to query some time server when the router is booted or restarted. it is recommended that the UDP Time Server Protocol be used for this purpose. a more advanced implementation would use the Network Time Protocol (NTP) to achieve nearly millisecond clock synchronization ๐ฅ. however, this is not required.
4.3.3.9 Address Mask Request/Reply ๐ญ
a router MUST implement support for receiving ICMP Address Mask Request messages and responding with ICMP Address Mask Reply messages. these messages are defined in [INTERNET:2] ๐.
a router SHOULD have a configuration option for each logical interface specifying whether the router is allowed to answer Address Mask Requests for that interface. this option MUST default to allowing responses. a router MUST NOT respond to an Address Mask Request before the router knows the correct address mask ๐ โโ๏ธ.
a router MUST NOT respond to an Address Mask Request that has a source address of 0.0.0.0 and which arrives on a physical interface that has associated with it multiple logical interfaces and the address masks for those interfaces are not all the same. no cap, that one's a big no ๐ซ.
a router SHOULD examine all ICMP Address Mask Replies that it receives to determine whether the information it contains matches the router's knowledge of the address mask. if the ICMP Address Mask Reply appears to be in error, the router SHOULD log the address mask and the sender's IP address ๐ต๏ธโโ๏ธ. a router MUST NOT use the contents of an ICMP Address Mask Reply to determine the correct address mask ๐.
because hosts may not be able to learn the address mask if a router is down when the host boots up, a router MAY broadcast a gratuitous ICMP Address Mask Reply on each of its logical interfaces after it has configured its own address masks ๐ก. however, this feature can be dangerous in environments that use variable length address masks, so it's giving caution ๐. therefore, if this feature is implemented, gratuitous Address Mask Replies MUST NOT be broadcast over any logical interface(s) which either:
- Are not configured to send gratuitous Address Mask Replies. Each logical interface MUST have a configuration parameter controlling this, and that parameter MUST default to not sending the gratuitous Address Mask Replies ๐
- Share subsuming (but not identical) network prefixes and physical interface ๐
the { <Network-prefix>, -1 } form of the IP broadcast address MUST be used for broadcast Address Mask Replies ๐.
DISCUSSION ๐ฌ
the ability to disable sending Address Mask Replies by routers is required at a few sites that intentionally lie to their hosts about the address mask ๐. the need for this is expected to go away as more and more hosts become compliant with the Host Requirements standards ๐ธ.
the reason for both the second bullet above and the requirement about which IP broadcast address to use is to prevent problems when multiple IP network prefixes are in use on the same physical network ๐ซถ.
4.3.3.10 Router Advertisement and Solicitations ๐ฃ
an IP router MUST support the router part of the ICMP Router Discovery Protocol [INTERNET:13] on all connected networks on which the router supports either IP multicast or IP broadcast addressing ๐ฐ๏ธ. the implementation MUST include all the configuration variables specified for routers, with the specified defaults โจ.
DISCUSSION ๐ฌ
routers are not required to implement the host part of the ICMP Router Discovery Protocol, but they might find it useful for operation while IP forwarding is disabled (i.e., when operating as a host) ๐ง.
DISCUSSION ๐ฌ
we note that it is quite common for hosts to use RIP Version 1 as the router discovery protocol ๐. such hosts listen to RIP traffic and use information extracted from that traffic to discover routers and to make decisions as to which router to use as a first-hop router for a given destination. while this behavior is discouraged, it is still common, and implementors should be aware of it ๐.
4.4 INTERNET GROUP MANAGEMENT PROTOCOL - IGMP ๐ฏโโ๏ธ
IGMP [INTERNET:4] is a protocol used between hosts and multicast routers on a single physical network to establish hosts' membership in particular multicast groups ๐ถ. multicast routers use this information, in conjunction with a multicast routing protocol, to support IP multicast forwarding across the Internet ๐.
a router SHOULD implement the host part of IGMP ๐.
5. INTERNET LAYER - FORWARDING ๐
5.1 INTRODUCTION ๐ท
this section describes the process of forwarding packets ๐ฆ.
5.2 FORWARDING WALK-THROUGH ๐บ๏ธ
there is no separate specification of the forwarding function in IP. instead, forwarding is covered by the protocol specifications for the internet layer protocols ([INTERNET:1], [INTERNET:2], [INTERNET:3], [INTERNET:8], and [ROUTE:11]) ๐.
5.2.1 Forwarding Algorithm ๐งฎ
since none of the primary protocol documents describe the forwarding algorithm in any detail, we present it here ๐ญ. this is just a general outline, and it omits important details, such as handling of congestion, which are dealt with in later sections ๐ซ .
it is not required that an implementation follow exactly the algorithms given in sections [5.2.1.1], [5.2.1.2], and [5.2.1.3]. much of the challenge of writing router software is to maximize the rate at which the router can forward packets while still achieving the same effect of the algorithm ๐๏ธ. details of how to do that are beyond the scope of this document, in part because they are heavily dependent on the architecture of the router. instead, we merely point out the order dependencies among the steps ๐:
(1) A router MUST verify the IP header, as described in section [5.2.2], before performing any actions based on the contents of the header. this allows the router to detect and discard bad packets before the expenditure of other resources ๐๏ธ.
(2) Processing of certain IP options requires that the router insert its IP address into the option. As noted in Section [5.2.4], the address inserted MUST be the address of the logical interface on which the packet is sent or the router's router-id if the packet is sent over an unnumbered interface. thus, processing of these options cannot be completed until after the output interface is chosen ๐งฉ.
(3) The router cannot check and decrement the TTL before checking whether the packet should be delivered to the router itself, for reasons mentioned in Section [4.2.2.9] โฑ๏ธ.
(4) More generally, when a packet is delivered locally to the router, its IP header MUST NOT be modified in any way (except that a router may be required to insert a timestamp into any Timestamp options in the IP header). thus, before the router determines whether the packet is to be delivered locally to the router, it cannot update the IP header in any way that it is not prepared to undo ๐.
5.2.1.1 General ๐
this section covers the general forwarding algorithm ๐ . this algorithm applies to all forms of packets to be forwarded: unicast, multicast, and broadcast ๐ฌ.
(1) The router receives the IP packet (plus additional information about it, as described in Section [3.1]) from the Link Layer ๐ฅ.
(2) The router validates the IP header, as described in Section [5.2.2]. note that IP reassembly is not done, except on IP fragments to be queued for local delivery in step (4) ๐ง.
(3) The router performs most of the processing of any IP options. As described in Section [5.2.4], some IP options require additional processing after the routing decision has been made ๐ช.
(4) The router examines the destination IP address of the IP datagram, as described in Section [5.2.3], to determine how it should continue to process the IP datagram. there are three possibilities ๐ฏ:
- The IP datagram is destined for the router, and should be queued for local delivery, doing reassembly if needed ๐ .
- The IP datagram is not destined for the router, and should be queued for forwarding ๐.
- The IP datagram should be queued for forwarding, but (a copy) must also be queued for local delivery ๐ฏ.
5.2.1.2 Unicast
okay so the local delivery case is already super well covered by [INTRO:2] ๐ , which means this part assumes the IP datagram got queued for forwarding. If the destination is an IP unicast address:
(5) The forwarder figures out the next hop IP address for the packet ๐บ๏ธ, usually by looking up the packet's destination in the router's routing table. This procedure is described in more detail in Section [5.2.4]. It also decides which network interface should be used to send the packet ๐ฆ
(6) The forwarder checks that forwarding the packet is permitted โ . The source and destination addresses should be valid, as described in Section [5.3.7] and Section [5.3.4]. If the router supports administrative constraints on forwarding, such as those described in Section [5.3.9], those constraints must be satisfied ๐
(7) The forwarder decrements the packet's TTL by at least one and checks it, as described in Section [5.3.1] โณ
(8) The forwarder performs any IP option processing that could not be completed in step 3 ๐
(9) The forwarder performs any necessary IP fragmentation, as described in Section [4.2.2.7] โ๏ธ Since this step happens after outbound interface selection (step 5), all fragments of the same datagram will go out the same interface, which is so neat ๐
(10) The forwarder determines the Link Layer address of the packet's next hop ๐ The mechanisms for doing this are Link Layer-dependent (see chapter 3).
(11) The forwarder encapsulates the IP datagram (or each of its fragments) in an appropriate Link Layer frame and queues it for output on the interface selected in step 5 ๐ฆ
(12) The forwarder sends an ICMP redirect if necessary, as described in Section [4.3.3.2] ๐ง
5.2.1.3 Multicast
If the destination is an IP multicast, the following steps are taken. ๐
Note that the main differences between forwarding IP unicasts and forwarding IP multicasts are:
- IP multicasts are usually forwarded based on both the datagram's source and destination IP addresses,
- IP multicast uses an expanding ring search,
- IP multicasts are forwarded as Link Level multicasts, and
- ICMP errors are never sent in response to IP multicast datagrams.
Note that the forwarding of IP multicasts is still somewhat experimental ๐งช As a result, the algorithm presented below is not mandatory, and is provided as an example only.
(5a) Based on the IP source and destination addresses in the datagram header, the router determines whether the datagram arrived on the proper interface for forwarding ๐ If not, the datagram is dropped silently. The method for finding the proper receiving interface depends on the multicast routing algorithm(s) in use. In one of the simplest algorithms, reverse path forwarding (RPF), the proper interface is the one that would be used to forward unicasts back to the datagram source ๐
(6a) Based on the IP source and destination addresses in the datagram header, the router determines the datagram's outgoing interfaces ๐ช To implement IP multicast's expanding ring search (see [INTERNET:4]), a minimum TTL value is specified for each outgoing interface. A copy of the multicast datagram is forwarded out each outgoing interface whose minimum TTL value is less than or equal to the TTL value in the datagram header, by separately applying the remaining steps on each such interface ๐ธ
(7a) The router decrements the packet's TTL by one โณ
(8a) The forwarder performs any IP option processing that could not be completed in step (3) ๐
(9a) The forwarder performs any necessary IP fragmentation, as described in Section [4.2.2.7] โ๏ธ
(10a) The forwarder determines the Link Layer address to use in the Link Level encapsulation ๐ The mechanisms for doing this are Link Layer-dependent. On LANs, a Link Level multicast or broadcast is selected, as an algorithmic translation of the datagram's IP multicast address. See the various IP-over-xxx specifications for more details ๐
(11a) The forwarder encapsulates the packet (or each of its fragments) in an appropriate Link Layer frame and queues it for output on the appropriate interface ๐ฆ
5.2.2 IP Header Validation
Before a router can process any IP packet, it MUST perform the following basic validity checks on the packet's IP header ๐ to make sure the header is meaningful. If the packet fails any of these tests, it MUST be silently discarded, and the error SHOULD be logged ๐
(1) The packet length reported by the Link Layer must be large enough to hold the minimum length legal IP datagram (20 bytes).
(2) The IP checksum must be correct โ
(3) The IP version number must be 4. If the version number is not 4, then the packet may be another version of IP, such as IPng or ST-II ๐
(4) The IP header length field must be large enough to hold the minimum length legal IP datagram (20 bytes = 5 words).
(5) The IP total length field must be large enough to hold the IP datagram header, whose length is specified in the IP header length field.
A router MUST NOT have a configuration option that allows disabling any of these tests. No exceptions, bestie ๐ โโ๏ธ
If the packet passes the second and third tests, the IP header length field is at least 4, and both the IP total length field and the packet length reported by the Link Layer are at least 16, then, despite the above rule, the router MAY respond with an ICMP Parameter Problem message ๐ Its pointer points at the IP header length field (if it failed the fourth test) or the IP total length field (if it failed the fifth test). However, it still MUST discard the packet, and it still SHOULD log the error.
These rules (and this entire document) apply only to version 4 of the Internet Protocol ๐ These rules should not be construed as prohibiting routers from supporting other versions of IP. Furthermore, if a router can truly classify a packet as being some other version of IP, then it ought not treat that packet as an error packet within the context of this memo ๐ฆ
IMPLEMENTATION
It's desirable for error reporting purposes, though not always entirely possible, to figure out why a header was invalid ๐ต๏ธโโ๏ธ There are four possible reasons:
- The Link Layer truncated the IP header
- The datagram is using a version of IP other than the standard one (version 4).
- The IP header has been corrupted in transit.
- The sender generated an illegal IP header.
It's probably desirable to perform the checks in the order listed, since we believe this ordering is most likely to correctly categorize the cause of the error ๐ข For error reporting purposes, it may also be desirable to check whether a packet that fails these tests has an IP version number indicating IPng or ST-II. These should be handled according to their respective specifications ๐ง
Additionally, the router SHOULD verify that the packet length reported by the Link Layer is at least as large as the IP total length recorded in the packet's IP header ๐ If it appears that the packet has been truncated, the packet MUST be discarded, the error SHOULD be logged, and the router SHOULD respond with an ICMP Parameter Problem message whose pointer points at the IP total length field ๐จ
DISCUSSION
Any higher layer protocol that cares about data corruption will detect truncation of the packet data when it reaches its final destination ๐ฏ So it isn't absolutely necessary for routers to perform the check suggested above to keep protocol correctness. However, by making this check, a router can simplify the task of figuring out which hop in the path is truncating the packets ๐ It also cuts down on resources spent downstream from the router, since downstream systems won't need to deal with the packet ๐
Finally, if the destination address in the IP header is not one of the router's addresses, the router SHOULD verify that the packet does not contain a Strict Source and Record Route option ๐บ๏ธ If a packet fails this test (that is, if it contains a strict source route option), the router SHOULD log the error and SHOULD respond with an ICMP Parameter Problem error, with the pointer pointing at the offending packet's IP destination address ๐ซถ
DISCUSSION
Some people might suggest that the router should respond with a Bad Source Route message instead of a Parameter Problem message ๐ค But when a packet fails this test, it usually means the previous hop router made a protocol error. Bad Source Route would instead suggest that the source host requested a nonexistent or broken path through the network, and that's a totally different situation, so it's giving "not the same problem" energy ๐โจ
5.2.3 Local Delivery Decision ๐ฌโจ
okay so when a router gets an IP packet, it has to figure out whether the packet is for the router itself (deliver it locally ๐ ) or for some other system (hand it to the forwarder ๐). there's also a hybrid case, where certain IP broadcasts and IP multicasts get delivered locally AND forwarded, which is so iconic ๐ฆ. A router MUST determine which of these three cases applies using the following rules ๐
- Unexpired source route: an unexpired source route option is one whose pointer value does not point past the last entry in the source route. if the packet has an unexpired source route option, the pointer gets advanced until either it points past the last address in the option, or the next address is not one of the router's own addresses. in that second case (the normal one ๐), the packet is forwarded and not delivered locally, no matter what the rules below say.
- Delivered locally, not considered for forwarding: this happens in these cases:
- the packet's destination address exactly matches one of the router's IP addresses,
- the packet's destination address is a limited broadcast address (
{-1, -1}), or - the packet's destination is an IP multicast address that is never forwarded (like
224.0.0.1or224.0.0.2) and at least one of the logical interfaces tied to the physical interface the packet arrived on is a member of that destination multicast group.
- Passed to the forwarder AND delivered locally: this happens in these cases:
- the packet's destination address is an IP broadcast address that addresses at least one of the router's logical interfaces, but doesn't address any of the logical interfaces tied to the physical interface the packet arrived on, or
- the packet's destination is an IP multicast address that is permitted to be forwarded (unlike
224.0.0.1and224.0.0.2) and at least one of the logical interfaces tied to the physical interface the packet arrived on is a member of the destination multicast group.
- Delivered locally, and maybe forwarded too: the packet is delivered locally if its destination address is an IP broadcast address (other than a limited broadcast address) that addresses at least one of the logical interfaces tied to the physical interface the packet arrived on. the packet is ALSO passed to the forwarder, unless the link it arrived on uses an IP encapsulation that does not encapsulate broadcasts differently than unicasts (for example, by using different Link Layer destination addresses) ๐ธ
- Everything else: the packet is passed to the forwarder in all other cases ๐ง
DISCUSSION ๐
ok so the point of the requirement in the last sentence of the fourth bullet is to deal with a directed broadcast to another network prefix on the same physical cable. normally this works just fine: the sender sends the broadcast to the router as a Link Layer unicast. the router notices it arrived as a unicast, which means it must be destined for a different network prefix than the one the sender sent it on. so the router can safely send it out as a Link Layer broadcast over the same (physical) interface it came in on ๐ BUT if the router can't tell whether the packet was received as a Link Layer unicast, the sentence makes sure the router does the safe-but-wrong thing instead of the unsafe-but-right thing ๐ญ
IMPLEMENTATION ๐ ๏ธ
so as described in Section [5.3.4], packets received as Link Layer broadcasts are generally not forwarded. it may be a good move to avoid passing packets to the forwarder that it would later throw away because of the rules in that section ๐
some Link Layers (because of the hardware, or because of special code in the drivers) can deliver to the router copies of all the Link Layer broadcasts and multicasts it transmits. using this feature can simplify things for the cases where a packet has to be passed to the forwarder AND delivered locally, since forwarding the packet automatically makes the router receive a copy it can then deliver locally. just be careful here, so you don't treat a received loop-back packet like a normal packet that was received (and then run it through the forwarding rules, etc.) ๐
even without that kind of Link Layer, it's honestly hardly necessary to copy a whole packet just to queue it for both forwarding and local delivery. still, be careful with fragments, since reassembly happens on locally delivered packets but NOT on forwarded ones ๐งฉ one simple scheme is to attach a flag to each packet on the router's output queue, saying whether it should be queued for local delivery after it's been sent โจ
5.2.4 Determining the Next Hop Address ๐บ๏ธ
when a router is about to forward a packet, it MUST figure out whether it can send the packet straight to its destination, or whether it has to pass it through another router. if it's the second one, it needs to pick which router to use. this section explains how those decisions get made ๐
this section uses the following definitions:
- LSRR: IP Loose Source and Record Route option
- SSRR: IP Strict Source and Record Route option
- Source Route Option: an LSRR or an SSRR
- Ultimate Destination Address: where the packet is being sent to, which is either the last address in the source route of a source-routed packet, or the destination address in the IP header of a non-source-routed packet
- Adjacent: reachable without going through any IP routers
- Next Hop Address: the IP address of the adjacent host or router the packet should be sent to next
- IP Destination Address: the ultimate destination address, except in source routed packets, where it's the next address specified in the source route
- Immediate Destination: the node, System, router, end-system, or whatever else is addressed by the IP Destination Address ๐ซถ
5.2.4.1 IP Destination Address ๐ฏ
if:
- the destination address in the IP header is one of the addresses of the router,
- the packet contains a Source Route Option, and
- the pointer in the Source Route Option does not point past the end of the option,
then the next IP Destination Address is the address the pointer points at in that option. if:
- the destination address in the IP header is one of the addresses of the router,
- the packet contains a Source Route Option, and
- the pointer in the Source Route Option points past the end of the option,
then the message is addressed to the system analyzing the message ๐ฆ
a router MUST use the IP Destination Address, NOT the Ultimate Destination Address (the last address in the source route option), when deciding how to handle a packet. no mixing those up, bestie ๐ โโ๏ธ
it is an error for more than one source route option to show up in a datagram. if a router gets a datagram like that, it SHOULD discard the packet and reply with an ICMP Parameter Problem message whose pointer points at the beginning of the second source route option ๐จ
5.2.4.2 Local/Remote Decision ๐
once it's been decided that the IP packet needs to be forwarded (following the rules in Section [5.2.3]), the following algorithm MUST be used to figure out whether the Immediate Destination is directly accessible (see [INTERNET:2]).
(1) for each network interface that hasn't been assigned any IP address (the unnumbered lines described in Section [2.2.7]), compare the router-id of the other end of the line to the IP Destination Address. if they're exactly equal, the packet can be transmitted through this interface ๐
DISCUSSION ๐ฌ
basically, the router or host at the remote end of the line is either the destination of the packet, or the next step in the source route of a source routed packet ๐
(2) if no network interface got selected in the first step, then for each IP address assigned to the router:
- (a) isolate the network prefix used by the interface.
IMPLEMENTATION ๐ ๏ธ
the result of this operation will usually have been computed and saved during initialization ๐ง
- (b) isolate the corresponding set of bits from the IP Destination Address of the packet.
- (c) compare the resulting network prefixes. if they're equal to each other, the packet can be transmitted through the corresponding network interface ๐
(3) if the destination was neither the router-id of a neighbor on an unnumbered interface nor a member of a directly connected network prefix, then the IP Destination is only accessible through some other router. how that router and its next hop IP address get selected is described in Section [5.2.4.3]. if the device is a host that isn't also a router, this might be the configured default router ๐
ongoing work in the IETF [ARCH:9, NRHP] looks at some cases, like when multiple IP (sub)networks are overlaid on the same link layer network. barring policy restrictions, hosts and routers using a common link layer network can communicate directly even if they're not in the same IP (sub)network, as long as there's adequate information available. the Next Hop Routing Protocol (NHRP) lets IP entities figure out the "optimal" link layer address to use for crossing such a link layer network toward a remote destination ๐ฐ๏ธ
(4) if the selected "next hop" is reachable through an interface configured to use NHRP, then these extra steps apply:
- (a) compare the IP Destination Address to the destination addresses in the NHRP cache. if the address is in the cache, send the datagram to the corresponding cached link layer address ๐
- (b) if the address isn't in the cache, construct an NHRP request packet containing the IP Destination Address. this message gets sent to the NHRP server configured for that interface. this may be a logically separate process or entity in the router itself ๐ฎ
- (c) the NHRP server will respond with the proper link layer address to use for transmitting the datagram, and subsequent datagrams to the same destination. the system MAY transmit the datagram(s) to the traditional "next hop" router while it's waiting for the NHRP reply ๐งโโ๏ธ
5.2.4.3 Next Hop Address โจ
EDITORS+COMMENTS
Okay so the router runs the algorithm from the previous section to check if the IP Destination Address is adjacent ๐. If it is, the next hop address is just the same as the IP Destination Address. If it isn't, the packet has to go through another router to reach its Immediate Destination, and picking that router is the whole topic of this section ๐ง.
If the packet has an SSRR, the router MUST discard the packet and reply with an ICMP Bad Source Route error ๐. Otherwise, the router looks up the IP Destination Address in its routing table to find an appropriate next hop address ๐ .
DISCUSSION
Per the IP spec, a Strict Source Route has to list a sequence of nodes that the packet must travel through. The packet has to go from one node of the source route to the next, and it can only cross intermediate networks along the way ๐บ๏ธ. So if the router isn't adjacent to the next step of the source route, the source route can not be fulfilled. That's why the router rejects it with an ICMP Bad Source Route error ๐ โโ๏ธ.
The goal of next-hop selection is to look through the entries in the router's Forwarding Information Base (FIB) and pick the best route (if there is one) from what's in the FIB ๐.
Conceptually, any route lookup starts with a set of candidate routes made of the entire FIB. Then the algorithm runs a series of steps that throw routes out of the set. These steps are called Pruning Rules โ๏ธ. Normally, by the time the algorithm finishes there is exactly one route left in the set, which is giving main character. If the set ever becomes empty, the packet is discarded because the destination is unreachable ๐ญ. The algorithm can also finish with more than one route still in the set. In that case the router may arbitrarily discard all but one of them, or it may do "load-splitting" by choosing whichever route has been least recently used ๐.
With the exception of rule 3 (Weak TOS), a router MUST use the following Pruning Rules when selecting a next hop for a packet. If a router does consider TOS when making next-hop decisions, the Rule 3 must be applied in the order indicated below. These rules MUST be (conceptually) applied to the FIB in the order they are presented. (For some historical tea, additional pruning rules and other common algorithms in use are in Appendix E ๐.)
DISCUSSION
Rule 3 is optional, because Section [5.3.2] says that a router only SHOULD consider TOS when making forwarding decisions ๐ค.
- (1) Basic Match This rule discards any routes to destinations other than the IP Destination Address of the packet. For example, if a packet's IP Destination Address is
10.144.2.5, this step would discard a route to net128.12.0.0/16but would keep any routes to the network prefixes10.0.0.0/8and10.144.0.0/16, plus any default routes ๐.
More precisely, we assume each route has a destination attribute called route.dest and a corresponding prefix length called route.length, which say which bits of route.dest are significant. The IP Destination Address of the packet being forwarded is ip.dest. This rule discards all routes from the set of candidates except the ones where the most significant route.length bits of route.dest and ip.dest are equal.
For example, if a packet's IP Destination Address is 10.144.2.5 and there are network prefixes 10.144.1.0/24, 10.144.2.0/24, and 10.144.3.0/24, this rule would keep only 10.144.2.0/24. It's the only route whose prefix has the same value as the matching bits in the packet's IP Destination Address ๐ฏ.
- (2) Longest Match Longest Match is a refinement of Basic Match. After Basic Match pruning, the algorithm checks the remaining routes to see which ones have the largest
route.lengthvalues. All the others get discarded ๐.
For example, if a packet's IP Destination Address is 10.144.2.5 and there are network prefixes 10.144.2.0/24, 10.144.0.0/16, and 10.0.0.0/8, this rule keeps only the first one, 10.144.2.0/24, because its prefix length is longest ๐.
- (3) Weak TOS Each route has a type of service attribute called
route.tos, whose possible values are assumed to be the same as those used in the TOS field of the IP header. Routing protocols that distribute TOS information fill inroute.tosappropriately for the routes they add to the FIB. Routes from other routing protocols are treated as if they have the default TOS (0000). The TOS field in the IP header of the packet being routed is calledip.tos.
The set of candidate routes is checked to see if it contains any routes where route.tos = ip.tos. If so, all routes except those where route.tos = ip.tos get discarded. If not, all routes except those where route.tos = 0000 get discarded from the set of candidate routes ๐.
More discussion of routing based on Weak TOS can be found in [ROUTE:11].
DISCUSSION
This rule basically means only routes with a TOS that matches the TOS the packet asked for get picked ๐. If no such routes exist, then routes with the default TOS are considered. Routes with a non-default TOS that isn't the requested one are never used, even if they're the only routes that go to the packet's destination ๐.
- (4) Best Metric Each route has a metric attribute called
route.metricand a routing domain identifier calledroute.domain. Each member of the set of candidate routes is compared with each other member. Ifroute.domainis equal for two routes androute.metricis strictly inferior for one when compared with the other, then the route with the inferior metric is discarded from the set. Usually "inferior" is decided by a simple arithmetic comparison, though some protocols may have structured metrics that need more complex comparisons ๐งฎ. - (5) Vendor Policy Vendor Policy is kind of a catch-all, to make up for the fact that the rules above are often not enough to choose between the possible routes. Vendor Policy pruning rules are extremely vendor-specific. See section [5.2.4.4] ๐ซถ.
This algorithm has two distinct disadvantages. Presumably, a router implementor might come up with techniques to deal with these and make them part of the Vendor Policy pruning rule ๐ ๏ธ.
- (1) IS-IS and OSPF route classes are not directly handled.
- (2) Path properties other than type of service (e.g., MTU) are ignored.
It's also worth noting a flaw in the way TOS is supported: routing protocols that support TOS are implicitly preferred when forwarding packets that have non-zero TOS values ๐ฌ.
The Basic Match and Longest Match pruning rules generalize the treatment of a number of particular route types. These routes are selected in the following decreasing order of preference โจ:
- (1) Host Route: This is a route to a specific end system.
- (2) Hierarchical Network Prefix Routes: This is a route to a particular network prefix. The FIB may contain several routes to network prefixes that subsume each other (one prefix is the other prefix with additional bits). These are selected in order of decreasing prefix length ๐ช.
- (5) Default Route: This is a route to all networks for which there are no explicit routes. By definition, it's the route whose prefix length is zero ๐ธ.
If, after the pruning rules are applied, the set of routes is empty (meaning no routes were found), the packet MUST be discarded and an appropriate ICMP error generated. That's ICMP Bad Source Route if the IP Destination Address came from a source route option. Otherwise it's whichever of ICMP Destination Host Unreachable or Destination Network Unreachable is appropriate, as described in Section [4.3.3.1] ๐ฅฒ.
5.2.4.4 Administrative Preference โจ
okay so this is the bit where we get to be the boss of which route wins ๐ One suggested way to handle the Vendor Policy Pruning Rule is administrative preference, which is basically a simple prioritization algorithm. You manually rank the routes you might have to pick between ๐
Every route gets a preference value based on its attributes (how to assign those values is coming up, bestie). The value is an integer in the range [0..255], where zero is the most preferred and 254 is the least preferred ๐ฆ And 255 is the special one that means the route should never be used ๐ The first step of the Vendor Policy pruning rule throws out everything except the most preferable routes, and it always tosses anything with a preference value of 255 ๐๏ธ
โ ๏ธ This policy is not safe. It can easily be misused to create routing loops, so no cap, be careful. Nothing in any protocol makes sure the preferences on your router match the preferences on its neighbors, so network managers have to be extra careful when they set these up ๐
Here are the ways you can assign preference values:
- Address Match: useful for giving one preference value to all routes (learned from the same routing domain) going to any of a set of destinations. That set is every destination that matches a specified network prefix ๐ธ
- Route Class: for routing protocols that keep track of route classes, you can give one preference value to all routes (learned from the same routing domain) in a particular class. The classes are intra-area, inter-area, external with internal metrics, and external with external metrics ๐ง
- Interface: useful for giving one preference value to all routes (learned from a particular routing domain) that would send packets out a particular logical interface on the router. Logical interfaces usually map one-to-one onto the router's network interfaces, except that any network interface with multiple IP addresses gets multiple logical interfaces ๐
- Source router: useful for giving one preference value to all routes (learned from the same routing domain) that were learned from any of a set of routers. That set is the routers whose updates have a source address matching a specified network prefix ๐
- Originating AS: for routing protocols that provide the info, you can give one preference value to all routes (learned from a particular routing domain) that originated in another particular routing domain. For BGP routes, the originating AS is the first AS listed in the route's AS_PATH attribute. For OSPF external routes, the originating AS may be considered to be the low order 16 bits of the route's external route tag, but only if the tag's Automatic bit is set and the tag's Path Length is not equal to 3 โจ
- External route tag: useful for giving one preference value to all OSPF external routes (learned from the same routing domain) whose external route tags match any value in a list of specified values. The external route tag can hold a structured value, so it may be handy to match particular subfields of the tag ๐
- AS path: it may be useful to give one preference value to all BGP routes (learned from the same routing domain) whose AS path "matches" any of a set of specified values. It's not yet clear exactly what kinds of matches are most useful ๐คทโโ๏ธ A simple option would be matching all routes where a particular AS number appears (or, alternatively, does not appear) anywhere in the route's AS_PATH attribute. A more general but somewhat harder option would be matching all routes whose AS path matches a specified regular expression ๐
5.2.4.5 Load Splitting ๐ฆ
okay, so by the end of the Next-hop selection process, you might still have several routes left ๐ฉ A router has a few options here. It may arbitrarily discard some of the routes. It may reduce the number of candidate routes by comparing metrics of routes from routing domains that are not considered equivalent. Or it may keep more than one route and use a load-splitting mechanism to divide traffic among them.
Honestly, the only thing you can really say about these options is that load-splitting is useful in some situations and not in others. So a wise implementor who implements load-splitting will also give the network manager a way to disable it ๐ซถ
5.2.5 Unused IP Header Bits: RFC-791 Section 3.1 ๐
The IP header has a few reserved bits, in the Type of Service field and in the Flags field. Routers MUST NOT drop packets merely because one or more of these reserved bits has a non-zero value ๐ โโ๏ธ
Routers MUST ignore and MUST pass through unchanged the values of these reserved bits. If a router fragments a packet, it MUST copy these bits into each fragment โจ
DISCUSSION Future revisions to the IP protocol may make use of these unused bits. These rules are intended to make sure those revisions can be deployed without having to upgrade all routers in the Internet at the same time ๐
5.2.6 Fragmentation and Reassembly: RFC-791 Section 3.2 ๐ง
As was discussed in Section [4.2.2.7], a router MUST support IP fragmentation ๐
A router MUST NOT reassemble any datagram before forwarding it ๐ซ
DISCUSSION A few people have suggested that there might be some topologies where reassembly of transit datagrams by routers might improve performance. But the fact that fragments may take different paths to the destination makes it unsafe to use such a feature ๐ Nothing in this section should be construed to control or limit fragmentation or reassembly performed as a link layer function by the router ๐ฅ Similarly, if an IP datagram is encapsulated in another IP datagram (e.g., it is tunnelled), and that datagram is in turn fragmented, the fragments must be reassembled in order to forward the original datagram. This section does not preclude this ๐ธ
5.2.7 Internet Control Message Protocol - ICMP ๐ฆ
General requirements for ICMP were discussed in Section [4.3]. This section discusses the ICMP messages that are sent only by routers ๐
5.2.7.1 Destination Unreachable ๐
The ICMP Destination Unreachable message is sent by a router in response to a packet it cannot forward, because the destination (or next hop) is unreachable or a service is unavailable ๐ Examples include a message addressed to a host that isn't there and therefore doesn't respond to ARP requests, and messages addressed to network prefixes the router has no valid route for ๐ญ
A router MUST be able to generate ICMP Destination Unreachable messages, and it SHOULD choose a response code that most closely matches the reason the message is being generated โจ
The following codes are defined in [INTERNET:8] and [INTRO:2]:
0 = Network Unreachable - generated by a router if a forwarding path
(route) to the destination network is not available;
1 = Host Unreachable - generated by a router if a forwarding path
(route) to the destination host on a directly connected network
is not available (does not respond to ARP);
2 = Protocol Unreachable - generated if the transport protocol
designated in a datagram is not supported in the transport layer
of the final destination;
3 = Port Unreachable - generated if the designated transport protocol
(e.g., UDP) is unable to demultiplex the datagram in the
transport layer of the final destination but has no protocol
mechanism to inform the sender;
4 = Fragmentation Needed and DF Set - generated if a router needs to
fragment a datagram but cannot since the DF flag is set;
5 = Source Route Failed - generated if a router cannot forward a
packet to the next hop in a source route option;
6 = Destination Network Unknown - This code SHOULD NOT be generated
since it would imply on the part of the router that the
destination network does not exist (net unreachable code 0
SHOULD be used in place of code 6);
7 = Destination Host Unknown - generated only when a router can
determine (from link layer advice) that the destination host
does not exist;
11 = Network Unreachable For Type Of Service - generated by a router
if a forwarding path (route) to the destination network with the
requested or default TOS is not available;
12 = Host Unreachable For Type Of Service - generated if a router
cannot forward a packet because its route(s) to the destination
do not match either the TOS requested in the datagram or the
default TOS (0).
The following additional codes are hereby defined ๐ง
13 = Communication Administratively Prohibited - generated if a
router cannot forward a packet due to administrative filtering;
14 = Host Precedence Violation. Sent by the first hop router to a
host to indicate that a requested precedence is not permitted
for the particular combination of source/destination host or
network, upper layer protocol, and source/destination port;
15 = Precedence cutoff in effect. The network operators have imposed
a minimum level of precedence required for operation, the
datagram was sent with a precedence below this level;
NOTE: [INTRO:2] defined Code 8 for source host isolated. Routers SHOULD NOT generate Code 8; whichever of Codes 0 (Network Unreachable) and 1 (Host Unreachable) is appropriate SHOULD be used instead. [INTRO:2] also defined Code 9 for communication with destination network administratively prohibited and Code 10 for communication with destination host administratively prohibited. These codes were intended for use by end-to-end encryption devices used by U.S military agencies. Routers SHOULD use the newly defined Code 13 (Communication Administratively Prohibited) if they administratively filter packets ๐ต๏ธโโ๏ธ
Routers MAY have a configuration option that causes Code 13 (Communication Administratively Prohibited) messages not to be generated. When this option is enabled, no ICMP error message is sent in response to a packet that is dropped because its forwarding is administratively prohibited ๐ซ
Similarly, routers MAY have a configuration option that causes Code 14 (Host Precedence Violation) and Code 15 (Precedence Cutoff in Effect) messages not to be generated. When this option is enabled, no ICMP error message is sent in response to a packet that is dropped because of a precedence violation ๐
Routers MUST use Host Unreachable or Destination Host Unknown codes whenever other hosts on the same destination network might be reachable. Otherwise, the source host may erroneously conclude that all hosts on the network are unreachable, and that may not be the case ๐ฑ
[INTERNET:14] describes a slight modification to the form of Destination Unreachable messages containing Code 4 (Fragmentation needed and DF set). A router MUST use this modified form when originating Code 4 Destination Unreachable messages ๐
5.2.7.2 Redirect โจ
okay so the ICMP Redirect message is how a router tells a local host, "hey bestie, for this particular kind of traffic, use a different next hop router instead" ๐๐ง
Routers MUST NOT generate the Redirect for Network or Redirect for Network and Type of Service messages (Codes 0 and 2) specified in [INTERNET:8]. Routers MUST be able to generate the Redirect for Host message (Code 1) and SHOULD be able to generate the Redirect for Type of Service and Host message (Code 3) specified in [INTERNET:8]. ๐ซถ
DISCUSSION ๐ If the directly connected network is not subnetted (in the classical sense), a router can normally generate a network Redirect that applies to all hosts on a specified remote network. Using a network rather than a host Redirect may economize slightly on network traffic and on host routing table storage. However, the savings are not significant, and subnets create an ambiguity about the subnet mask to be used to interpret a network Redirect. In a CIDR environment, it is difficult to specify precisely the cases in which network Redirects can be used. Therefore, routers must send only host (or host and type of service) Redirects. ๐
A Code 3 (Redirect for Host and Type of Service) message is generated when the packet provoking the redirect has a destination for which the path chosen by the router would depend (in part) on the TOS requested. ๐ฆ
Routers that can generate Code 3 redirects (Host and Type of Service) MUST have a configuration option (which defaults to on) to enable Code 1 (Host) redirects to be substituted for Code 3 redirects. A router MUST send a Code 1 Redirect in place of a Code 3 Redirect if it has been configured to do so. ๐ธ
If a router is not able to generate Code 3 Redirects, then it MUST generate Code 1 Redirects in situations where a Code 3 Redirect is called for. โญ
Routers MUST NOT generate a Redirect Message unless all the following conditions are met:
- The packet is being forwarded out the same physical interface that it was received from,
- The IP source address in the packet is on the same Logical IP (sub)network as the next-hop IP address, and
- The packet does not contain an IP source route option.
The source address used in the ICMP Redirect MUST belong to the same logical (sub)net as the destination address. ๐
A router using a routing protocol (other than static routes) MUST NOT consider paths learned from ICMP Redirects when forwarding a packet. If a router is not using a routing protocol, a router MAY have a configuration that, if set, allows the router to consider routes learned through ICMP Redirects when forwarding packets. ๐
DISCUSSION ๐ ICMP Redirect is a mechanism for routers to convey routing information to hosts. Routers use other mechanisms to learn routing information, and therefore have no reason to obey redirects. Believing a redirect which contradicted the router's other information would likely create routing loops. ๐ญ
On the other hand, when a router is not acting as a router, it MUST comply with the behavior required of a host. not me being a router and suddenly acting like a host ๐
5.2.7.3 Time Exceeded โณ
A router MUST generate a Time Exceeded message Code 0 (In Transit) when it discards a packet due to an expired TTL field. A router MAY have a per-interface option to disable origination of these messages on that interface, but that option MUST default to allowing the messages to be originated. ๐
5.2.8 INTERNET GROUP MANAGEMENT PROTOCOL - IGMP ๐
IGMP [INTERNET:4] is a protocol used between hosts and multicast routers on a single physical network to establish hosts' membership in particular multicast groups. Multicast routers use this information, in conjunction with a multicast routing protocol, to support IP multicast forwarding across the Internet. ๐
A router SHOULD implement the multicast router part of IGMP. โจ
5.3. SPECIFIC ISSUES ๐
5.3.1 Time to Live (TTL) โฐ
The Time-to-Live (TTL) field of the IP header is defined to be a timer limiting the lifetime of a datagram. It is an 8-bit field and the units are seconds. Each router (or other module) that handles a packet MUST decrement the TTL by at least one, even if the elapsed time was much less than a second. Since this is very often the case, the TTL is effectively a hop count limit on how far a datagram can propagate through the Internet. ๐ฆ
When a router forwards a packet, it MUST reduce the TTL by at least one. If it holds a packet for more than one second, it MAY decrement the TTL by one for each second. ๐ง
If the TTL is reduced to zero (or less), the packet MUST be discarded, and if the destination is not a multicast address, the router MUST send an ICMP Time Exceeded message, Code 0 (TTL Exceeded in Transit) message to the source. Note that a router MUST NOT discard an IP unicast or broadcast packet with a non-zero TTL merely because it can predict that another router on the path to the packet's final destination will decrement the TTL to zero. However, a router MAY do so for IP multicasts, in order to more efficiently implement IP multicast's expanding ring search algorithm (see [INTERNET:4]). ๐
โ ๏ธ bestie, a router MUST NOT throw away a unicast or broadcast packet with a non-zero TTL just because it predicts another router will zero it out. only multicast gets that exception (MAY). ๐
DISCUSSION ๐ฅ The IP TTL is used, somewhat schizophrenically, as both a hop count limit and a time limit. Its hop count function is critical to ensuring that routing problems can't melt down the network by causing packets to loop infinitely in the network. The time limit function is used by transport protocols such as TCP to ensure reliable data transfer. Many current implementations treat TTL as a pure hop count, and in parts of the Internet community there is a strong sentiment that the time limit function should instead be performed by the transport protocols that need it. โณ
In this specification, we have reluctantly decided to follow the strong belief among the router vendors that the time limit function should be optional. They argued that implementation of the time limit function is difficult enough that it is currently not generally done. They further pointed to the lack of documented cases where this shortcut has caused TCP to corrupt data (of course, we would expect the problems created to be rare and difficult to reproduce, so the lack of documented cases provides little reassurance that there haven't been a number of undocumented cases). ๐ฅบ
IP multicast notions such as the expanding ring search may not work as expected unless the TTL is treated as a pure hop count. The same thing is somewhat true of traceroute. ๐
ICMP Time Exceeded messages are required because the traceroute diagnostic tool depends on them. โจ
Thus, the tradeoff is between severely crippling, if not eliminating, two very useful tools and avoiding a very rare and transient data transport problem that may not occur at all. We have chosen to preserve the tools. ๐
5.3.2 Type of Service (TOS) ๐ท
The Type-of-Service byte in the IP header is divided into three sections: the Precedence field (high-order 3 bits), a field that is customarily called Type of Service or "TOS (next 4 bits), and a reserved bit (the low order bit). Rules governing the reserved bit were described in Section [4.2.2.3]. The Precedence field will be discussed in Section [5.3.3]. A more extensive discussion of the TOS field and its use can be found in [ROUTE:11]. ๐
A router SHOULD consider the TOS field in a packet's IP header when deciding how to forward it. The remainder of this section describes the rules that apply to routers that conform to this requirement. ๐ฆ
A router MUST maintain a TOS value for each route in its routing table. Routes learned through a routing protocol that does not support TOS MUST be assigned a TOS of zero (the default TOS). ๐ธ
To choose a route to a destination, a router MUST use an algorithm equivalent to the following:
(1) The router locates in its routing table all available routes to the destination (see Section [5.2.4]).
(2) If there are none, the router drops the packet because the destination is unreachable. See section [5.2.4].
(3) If one or more of those routes have a TOS that exactly matches the TOS specified in the packet, the router chooses the route with the best metric.
(4) Otherwise, the router repeats the above step, except looking at routes whose TOS is zero.
(5) If no route was chosen above, the router drops the packet because the destination is unreachable. The router returns an ICMP Destination Unreachable error specifying the appropriate code: either Network Unreachable with Type of Service (code 11) or Host Unreachable with Type of Service (code 12). ๐
DISCUSSION ๐ Although TOS has been little used in the past, its use by hosts is now mandated by the Requirements for Internet Hosts RFCs ([INTRO:2] and [INTRO:3]). Support for TOS in routers may become a MUST in the future, but is a SHOULD for now until we get more experience with it and can better judge both its benefits and its costs. ๐ซถ
Various people have proposed that TOS should affect other aspects of the forwarding function. For example:
(1) A router could place packets that have the Low Delay bit set ahead of other packets in its output queues.
(2) If a router is forced to discard packets, it could try to avoid discarding those which have the High Reliability bit set.
These ideas have been explored in more detail in [INTERNET:17], but we don't yet have enough experience with such schemes to make requirements in this area. that's the whole TOS saga, periodt ๐โจ
5.3.3 IP Precedence โจ
Okay bestie, this section is all about how routers handle the IP Precedence field ๐ It's basically a way to decide which traffic matters most when the network is busy, and the IP spec already defines the specific values for different kinds of traffic ๐
The main tools a router uses for precedence are preferential resource allocation (that's precedence-ordered queue service and precedence-based congestion control) and picking Link Layer priority features. Routers also choose the IP precedence for the routing, management, and control traffic they start themselves. For the full tea on IP Precedence and how to implement it, check out [FORWARD:6] ๐ซถ
Precedence-ordered queue service covers more than just the queue for the forwarding process and the queues for outgoing links, so don't sleep on the other spots too ๐ธ A router that supports precedence should also use the precedence indication anywhere it's deciding who gets finite resources, like packet buffers or Link Layer connections. Which exact spots those are depends on the implementation ๐ฆ
DISCUSSION
Okay so the Precedence field was originally made for DOD systems, where huge traffic surges or major damage to the network are seen as real threats. But it's super useful for lots of non-military IP networks too ๐ Network traffic capacity has grown a ton lately, but users are generating way more traffic too, so overloads still happen sometimes ๐ญ Since IP-based routing and management protocols are now way more critical to the Internet working properly, overloads bring two extra risks:
(1) High delays may result in routing protocol packets being lost. This may cause the routing protocol to falsely deduce a topology change and propagate this false information to other routers. Not only can this make routes oscillate, but it can also dump an extra processing burden on other routers ๐
(2) High delays may interfere with the use of network management tools to analyze and perhaps correct or relieve the problem in the network that caused the overload condition to occur ๐
Using the Precedence mechanism properly (and actually implementing it) helps fix both of these problems ๐
5.3.3.1 Precedence-Ordered Queue Service
Routers SHOULD implement precedence-ordered queue service. Here's how it works: when a packet is selected for output on a (logical) link, the packet with the highest precedence that's been queued for that link gets sent first ๐ฅ Routers that implement precedence-ordered queue service MUST also have a configuration option to suppress precedence-ordered queue service in the Internet Layer.
Any router MAY implement other policy-based throughput management procedures that result in something other than strict precedence ordering, but it MUST be configurable to suppress them (i.e., use strict ordering) ๐ง
As detailed in Section [5.3.6], routers that implement precedence-ordered queue service discard low precedence packets before discarding high precedence packets for congestion control purposes ๐ซง
Preemption (interrupting the processing or transmission of a packet) is not envisioned as a function of the Internet Layer. Some protocols at other layers may provide preemption features โจ
5.3.3.2 Lower Layer Precedence Mappings
Routers that implement precedence-ordered queuing MUST IMPLEMENT, and other routers SHOULD IMPLEMENT, Lower Layer Precedence Mapping ๐
A router that implements Lower Layer Precedence Mapping:
- MUST be able to map IP Precedence to Link Layer priority mechanisms for link layers that have such a feature defined.
- MUST have a configuration option to select the Link Layer's default priority treatment for all IP traffic.
- SHOULD be able to configure specific nonstandard mappings of IP precedence values to Link Layer priority values for each interface.
DISCUSSION
Some research questions whether the priority features of some Link Layer protocols actually work, and some networks may have faulty implementations of the link layer priority mechanism ๐ So it seems smart to provide an escape hatch in case those problems show up in a network ๐
On the other hand, there are proposals to use novel queuing strategies for special services like multimedia bandwidth reservation or low-delay service. Those special services and the queuing strategies that support them are current research topics and are in the process of standardization ๐ฌ
Implementors may want to keep in mind that correct link layer mapping of IP precedence is required by DOD policy for TCP/IP systems used on DOD networks. These requirements are meant to encourage (but not force) the use of precedence features, in the hope of giving all users better Internet service ๐ซถ So routers supporting precedence-ordered queue service should default to keeping strict precedence ordering, no matter what type of service gets requested ๐
5.3.3.3 Precedence Handling For All Routers
A router, whether or not it uses precedence-ordered queue service:
(1) MUST accept and process incoming traffic of all precedence levels normally, unless it has been administratively configured to do otherwise.
(2) MAY implement a validation filter to administratively restrict the use of precedence levels by particular traffic sources. If one is provided, this filter MUST NOT filter out or cut off the following sorts of ICMP error messages: Destination Unreachable, Redirect, Time Exceeded, and Parameter Problem. If this filter is provided, the procedures required for packet filtering by addresses are required for this filter as well.
DISCUSSION
Precedence filtering should be applicable to specific source/destination IP Address pairs, specific protocols, specific ports, and so on ๐ฏ
An ICMP Destination Unreachable message with code 14 SHOULD be sent when a packet is dropped by the validation filter, unless this has been suppressed by configuration choice.
(3) MAY implement a cutoff function that allows the router to be set to refuse or drop traffic with precedence below a specified level. This function may be activated by management actions or by some implementation-dependent heuristics, but there MUST be a configuration option to disable any heuristic mechanism that operates without human intervention. An ICMP Destination Unreachable message with code 15 SHOULD be sent when a packet is dropped by the cutoff function, unless this has been suppressed by configuration choice.
A router MUST NOT refuse to forward datagrams with IP precedence of 6 (Internetwork Control) or 7 (Network Control) solely due to precedence cutoff. However, other criteria may be used in conjunction with precedence cutoff to filter high precedence traffic ๐ซ
DISCUSSION
Unrestricted precedence cutoff could accidentally cut off routing and control traffic, which would be a total disaster ๐ฑ In the general case, host traffic should be restricted to a value of 5 (CRITIC/ECP) or below. This is not a requirement, and it may not be correct in certain systems ๐
(4) MUST NOT change precedence settings on packets it did not originate.
(5) SHOULD be able to configure distinct precedence values to be used for each routing or management protocol supported (except for those protocols, such as OSPF, which specify which precedence value must be used).
(6) MAY be able to configure routing or management traffic precedence values independently for each peer address.
(7) MUST respond appropriately to Link Layer precedence-related error indications where provided. An ICMP Destination Unreachable message with code 15 SHOULD be sent when a packet is dropped because a link cannot accept it due to a precedence-related condition, unless this has been suppressed by configuration choice.
DISCUSSION
The precedence cutoff mechanism described in (3) is kind of controversial, ngl ๐ฅบ Depending on where the affected area sits in the topology, routing protocols may steer transit traffic into the area of the cutoff, where it gets dropped. This is only a problem if some other path that's unaffected by the cutoff exists between the communicating points. Proposed fixes include providing some minimum bandwidth to all precedence levels even under overload conditions, or propagating cutoff information in routing protocols. Until there's a widely accepted (and implemented) solution, great caution is recommended when activating cutoff mechanisms in transit networks ๐ฆ
A transport layer relay could legitimately provide the function prohibited by (4) above. Changing precedence levels may cause subtle interactions with TCP and perhaps other protocols, and a correct design is a non-trivial task ๐ง
The intent of (5) and (6) (and the discussion of IP Precedence in ICMP messages in Section [4.3.2]) is that the IP precedence bits should be set appropriately, whether or not this router acts on those bits in any other way. We expect that future specifications for routing protocols and network management protocols will specify how the IP Precedence should be set for messages sent by those protocols ๐ฌ
The right response for (7) depends on the link layer protocol in use. Typically, the router should stop trying to send offensive traffic to that destination for some period of time, and should return an ICMP Destination Unreachable message with code 15 (service not available for precedence requested) to the traffic source. It also should not try to reestablish a preempted Link Layer connection for some time ๐
5.3.4 Forwarding of Link Layer Broadcasts โจ
okay so bestie, most Link Layer protocols (everything except PPP ๐ซถ) wrap IP packets in a way that lets a receiver tell broadcasts and multicasts apart from unicasts just by peeking at the Link Layer headers, usually the Link Layer destination address ๐. The rules in this section about Link Layer broadcasts only apply to Link Layer protocols that can actually make that distinction, and the same goes for the Link Layer multicast rules ๐ .
A router MUST NOT forward any packet it received as a Link Layer broadcast, unless it's aimed at an IP multicast address. In that special case, the idea is that the sender probably used a link layer broadcast only because there was no working multicast service around ๐ง.
A router MUST NOT forward any packet it received as a Link Layer multicast unless the packet's destination address is an IP multicast address ๐.
A router SHOULD silently discard a packet that arrives via a Link Layer broadcast but doesn't name an IP multicast or IP broadcast destination address ๐.
When a router sends a packet as a Link Layer broadcast, the IP destination address MUST be a legal IP broadcast or IP multicast address. no notes, no exceptions ๐โจ
5.3.5 Forwarding of Internet Layer Broadcasts ๐ฆ
there are two major kinds of IP broadcast addresses: limited broadcast and directed broadcast ๐. directed broadcast then splits into three subtypes: one aimed at a specified network prefix, one aimed at a specified subnetwork, and one aimed at all subnets of a specified network ๐. which bucket a broadcast lands in depends on the broadcast address and on how much the router knows about the destination network's subnet structure (if it knows anything at all). so the same broadcast can get sorted differently by different routers, which is kind of wild ๐ญ
a limited IP broadcast address is all-ones: { -1, -1 } or 255.255.255.255 ๐ฅ.
a network-prefix-directed broadcast is the network prefix of the IP address with an all-ones local part, written as { <Network-prefix>, -1 }. for example, a Class A net broadcast address is net.255.255.255, a Class B net broadcast address is net.net.255.255, and a Class C net broadcast address is net.net.net.255, where net is a byte of the network address ๐.
the all-subnets-directed-broadcast isn't well defined in a CIDR environment, and it was deprecated in version 1 of this memo ๐.
as was described in Section [4.2.3.1], a router may run into certain non-standard IP broadcast addresses ๐:
0.0.0.0is an obsolete form of the limited broadcast address{ <Network-prefix>, 0 }is an obsolete form of a network-prefix-directed broadcast address
as that section explained, packets sent to any of these addresses SHOULD be silently discarded. but if they aren't discarded, they MUST be treated under the same rules that apply to packets sent to the non-obsolete forms of the broadcast addresses above. those rules are coming up in the next few sections ๐ธ
5.3.5.1 Limited Broadcasts ๐
limited broadcasts MUST NOT be forwarded. limited broadcasts MUST NOT be discarded. limited broadcasts MAY be sent, and SHOULD be sent instead of directed broadcasts wherever a limited broadcast will do the job โจ
DISCUSSION some routers have UDP servers that work by resending requests (as unicasts or directed broadcasts) to other servers. this requirement should not be read as banning those servers ๐ซถ but fair warning: those servers can easily cause packet looping if they're misconfigured ๐ญ. so providers running them would probably be wise to document their setup carefully and think hard about the TTL on the packets they send ๐ง
5.3.5.2 Directed Broadcasts ๐
a router MUST classify as network-prefix-directed broadcasts all valid directed broadcasts destined for a remote network or an attached non-subnetted network ๐ . since CIDR is a thing, these may look like host addresses within the network prefix, and we don't go poking around in the host part of those prefixes ๐. so given a route and no overriding policy, a router MUST forward network-prefix-directed broadcasts. network-prefix-directed broadcasts MAY be sent ๐ฆ
a router MAY have an option to disable receiving network-prefix-directed broadcasts on an interface, and it MUST have an option to disable forwarding network-prefix-directed broadcasts. those options MUST default to permitting the receiving and forwarding of network-prefix-directed broadcasts ๐
DISCUSSION there's been a lot of debate about whether to forward directed broadcasts or not ๐. in this memo, the forwarding decision depends on the router's knowledge of the destination network prefix. routers can't tell whether a message is unicast or a directed broadcast without that knowledge. so by definition, the decision to forward or not is only possible at the last hop router ๐
5.3.5.3 All-subnets-directed Broadcasts ๐ธ
the first version of this memo described an algorithm for spreading a directed broadcast out to all the subnets of a classful network number. it was called "broken," and certain failure cases were spelled out ๐ญ
in a CIDR routing domain, where classful IP network numbers mean nothing, the idea of an all-subnets-directed-broadcast is also meaningless ๐. as far as the working group knows, the facility was never implemented or deployed, and it's now officially relegated to the dustbin of history ๐๏ธโจ
5.3.5.4 Subnet-directed Broadcasts ๐ง
the first version of this memo laid out procedures for dealing with subnet-directed broadcasts. in a CIDR routing domain, these are indistinguishable from net-directed broadcasts ๐ฆ. so the two are treated together in section [5.3.5.2 Directed Broadcasts], and they should be viewed as network-prefix directed broadcasts ๐
5.3.6 Congestion Control ๐ฅ
congestion on a network is loosely defined as the situation where demand for resources (usually bandwidth or CPU time) goes past capacity ๐ค. congestion avoidance tries to keep demand from exceeding capacity, while congestion recovery tries to get things back into a working state. a router can contribute to both of these mechanisms ๐ซถ. people have put a LOT of effort into studying this problem, so the reader is encouraged to check out [FORWARD:2] for a survey of the work. important papers on the subject include [FORWARD:3], [FORWARD:4], [FORWARD:5], [FORWARD:10], [FORWARD:11], [FORWARD:12], [FORWARD:13], [FORWARD:14], and [INTERNET:10], among others ๐โจ
the amount of storage a router should have available to handle peak instantaneous demand, when hosts use reasonable congestion policies such as the ones described in [FORWARD:5], is a function of the bandwidth of the link times the path delay of the flows using that link. so storage should grow as this Bandwidth*Delay product grows ๐. the exact function relating storage capacity to the probability of discard isn't known ๐คทโโ๏ธ
when a router gets a packet beyond its storage capacity, it must (by definition, not by decree) discard it or some other packet or packets ๐ . which packet to discard has been studied to death but, unfortunately, the field still agrees on very little ๐ญ. the best wisdom so far suggests discarding a packet from the data stream that's using the link the most. however, a number of other factors may matter too, including the precedence of the traffic, active bandwidth reservations, and how complicated it is to select that packet ๐
a router MAY discard the packet it has just received. this is the simplest approach, but it's not the best policy ๐. ideally, the router should pick a packet from one of the sessions most heavily abusing the link, as long as the applicable Quality of Service policy allows it ๐. a recommended policy in datagram environments using FIFO queues is to discard a packet randomly selected from the queue (see [FORWARD:5]). an equivalent algorithm in routers using fair queues is to discard from the longest queue, or from the one with the greatest virtual time (see [FORWARD:13]). a router MAY use these algorithms to decide which packet to discard ๐
if a router uses a discard policy (like Random Drop) that picks a packet to discard from a pool of eligible packets, then ๐:
- if precedence-ordered queue service (described in Section [5.3.3.1]) is implemented and enabled, the router MUST NOT discard a packet whose IP precedence is higher than that of a packet that is not discarded ๐ฅ
- a router MAY protect packets whose IP headers request the maximize reliability TOS, except where doing so would violate the previous rule ๐ฆ
- a router MAY protect fragmented IP packets, on the theory that dropping one fragment of a datagram may increase congestion by causing all fragments of the datagram to be retransmitted by the source ๐งฉ
- to help prevent routing perturbations or disruption of management functions, the router MAY protect packets used for routing control, link control, or network management from being discarded. dedicated routers (meaning routers that aren't also general purpose hosts, terminal servers, etc.) can get an approximation of this rule by protecting packets whose source or destination is the router itself ๐ธ
advanced methods of congestion control include a notion of fairness, so the 'user' who gets penalized by losing a packet is the one who contributed the most to the congestion ๐. no matter what mechanism is used to handle bandwidth congestion control, it's important that the CPU effort spent stays small enough that the router doesn't also get driven into CPU congestion ๐ง ๐
as described in Section [4.3.3.3], this document recommends that a router SHOULD NOT send a Source Quench to the sender of the packet it's discarding. ICMP Source Quench is a very weak mechanism, so a router doesn't need to send it, and host software should not use it exclusively as a sign of congestion ๐ โโ๏ธ๐
5.3.7 Martian Address Filtering โจ
okay bestie, so an IP source address is invalid if it's a special IP address (as defined in 4.2.2.11 or 5.3.7) or if it's not a unicast address ๐ an IP destination address is invalid if it's one of the illegal destinations listed in 4.2.3.1, or if it's a Class E address (except 255.255.255.255) ๐
a router SHOULD NOT forward any packet that has an invalid IP source address or a source address on network 0 ๐ซ it also SHOULD NOT forward, except over a loopback interface, any packet that has a source address on network 127 ๐ธ a router MAY have a switch that lets the network manager turn these checks off ๐ but if that switch exists, it MUST default to performing the checks ๐ซถ
same energy for destinations: a router SHOULD NOT forward any packet with an invalid IP destination address or a destination address on network 0, and SHOULD NOT forward (except over a loopback interface) any packet with a destination address on network 127 ๐ฆ again, a router MAY have a disable switch for these checks, and if it does, it MUST default to performing them โจ
and if a router throws a packet away because of these rules, it SHOULD log at least the IP source address and the IP destination address ๐ if the problem was with the source address, it should also log the physical interface the packet came in on, plus the Link Layer address of the host or router it came from ๐ฅ
5.3.8 Source Address Validation ๐ต๏ธโโ๏ธ
a router SHOULD IMPLEMENT the ability to filter traffic by comparing a packet's source address with the forwarding table for the logical interface the packet arrived on ๐ if this filtering is turned on, the router MUST silently discard the packet whenever the interface it arrived on isn't the one it would use to forward a packet toward that source address ๐ in simpler terms: if the router wouldn't route a packet with this address out through a particular interface, it shouldn't trust that address when it shows up as a source on packets read from that interface ๐ โโ๏ธ
if this feature is implemented, it MUST be disabled by default ๐ง
DISCUSSION ๐ This feature can provide useful security improvements in some situations, but it can erroneously discard valid packets when paths are asymmetric. ๐ญ
5.3.9 Packet Filtering and Access Lists ๐ก๏ธ
so a router SHOULD provide a way to selectively forward (or filter) packets ๐ this helps with security and with limiting traffic in parts of a network โจ if that capability exists, filtering SHOULD be configurable either to forward all packets or to forward them selectively based on source and destination prefixes ๐ it MAY also filter on other message attributes, and each source and destination address SHOULD allow an arbitrary prefix length ๐
DISCUSSION ๐ This feature can give a measure of privacy, where systems outside a boundary aren't allowed to exchange certain protocols with systems inside it, or are limited in which systems they can talk to ๐ซฃ it can also help prevent certain security breaches, where a system outside a boundary pretends to be a system inside the boundary and fakes a session with it ๐ฑ
if this is supported, a router SHOULD be configurable to use one of these:
- Include list: a list of message definitions that get forwarded ๐
- Exclude list: a list of message definitions that do not get forwarded ๐ โโ๏ธ
a "message definition" here specifies the source and destination network prefix, and it may include other identifying info, like the IP Protocol Type or the TCP port number ๐งฉ
a router MAY provide a configuration switch that lets you pick between an include list and an exclude list, or other equivalent controls ๐
any value that matches any address (like the keyword any, an address with a mask of all 0's, or a network prefix with length zero) MUST be allowed as a source and/or destination address ๐
on top of address pairs, the router MAY let you specify any combination of transport and/or application protocol and source and destination ports โญ
the router MUST allow packets to be silently discarded (meaning discarded without an ICMP error message being sent) ๐คซ
the router SHOULD allow an appropriate ICMP unreachable message to be sent when a packet is discarded ๐จ that ICMP message SHOULD specify Communication Administratively Prohibited (code 13) as the reason the destination is unreachable ๐ง
the router SHOULD allow ICMP destination unreachable messages (code 13) to be configured for each combination of address pairs, protocol types, and ports it lets you specify ๐ฏ
last but not least, the router SHOULD count packets it doesn't forward and SHOULD allow selective logging of them ๐
5.3.10 Multicast Routing ๐ก
an IP router SHOULD support forwarding IP multicast packets, either based on static multicast routes or on routes dynamically determined by a multicast routing protocol (for example, DVMRP [ROUTE:9]) ๐งโโ๏ธ a router that forwards IP multicast packets is called a multicast router ๐ซ
5.3.11 Controls on Forwarding ๐๏ธ
for each physical interface, a router SHOULD have a configuration option that says whether forwarding is enabled on that interface ๐ when forwarding on an interface is disabled, the router:
- MUST silently discard any packets it receives on that interface that aren't addressed to the router ๐
- MUST NOT send packets out that interface, except for datagrams the router itself originated ๐ญ
- MUST NOT announce, through any routing protocols, that paths through the interface are available ๐ค
DISCUSSION ๐ this feature lets the network manager basically turn off an interface while still keeping it reachable for network management ๐ ๏ธ
ideally, this control would apply to logical interfaces rather than physical ones ๐ฅบ it can't, though, because there's no known way for a router to figure out which logical interface a packet arrived on unless there's a one-to-one match between logical and physical interfaces ๐ตโ๐ซ
5.3.12 State Changes ๐
while the router is running, interfaces may fail or be manually disabled, or may become available for the router to use ๐ช๏ธ forwarding may also be disabled for a particular interface or for the whole router, or it may be (re)enabled ๐ these transitions are (usually) uncommon, but it's super important that routers handle them correctly ๐ซถ
5.3.12.1 When a Router Ceases Forwarding ๐
when a router stops forwarding, it MUST stop advertising all routes, except for third party routes ๐ข it MAY keep receiving and using routes from other routers in its routing domains ๐ if the forwarding database is kept, the router MUST NOT stop timing the routes in it ๐ฐ๏ธ if routes it learned from other routers are remembered, the router MUST NOT stop timing those remembered routes either โฑ๏ธ and it MUST discard any routes whose timers expire while forwarding is disabled, the same as it would if forwarding were on ๐๏ธ
DISCUSSION ๐ธ when a router stops forwarding, it's basically no longer a router ๐ฎ it's still a host, so it has to follow all the requirements of Host Requirements [INTRO:2] ๐ the router can still be a passive member of one or more routing domains, though, so it's allowed to keep its forwarding database up to date by listening to other routers in its routing domain ๐ it may not advertise any of the routes in that database, since it isn't forwarding anything itself ๐ โโ๏ธ the only exception is when the router is advertising a route that uses only some other router, but which this router has been asked to advertise ๐
a router MAY send ICMP destination unreachable (host unreachable) messages to the senders of packets it can't forward ๐ฌ it SHOULD NOT send ICMP redirect messages ๐ซ
DISCUSSION ๐ sending an ICMP destination unreachable (host unreachable) message is a router action, so hosts shouldn't send it ๐ง this exception to the host rules is allowed so packets can be rerouted as fast as possible and so black holes are avoided ๐ณ๏ธ
5.3.12.2 When a Router Starts Forwarding ๐
when a router begins forwarding, it SHOULD speed up sending its new routing information to all the routers it normally exchanges routing information with ๐จ
5.3.12.3 When an Interface Fails or is Disabled ๐
if an interface fails or gets disabled, a router MUST remove and stop advertising all routes in its forwarding database that use that interface ๐๏ธ it MUST disable all static routes that use that interface too ๐ if other routes to the same destination and TOS are learned or remembered by the router, the router MUST choose the best alternate and add it to its forwarding database ๐ and the router SHOULD send ICMP destination unreachable or ICMP redirect messages, as appropriate, in reply to all packets it can't forward because the interface is unavailable ๐ฎ
5.3.12.4 When an Interface is Enabled ๐
if an interface that wasn't available becomes available, a router MUST re-enable any static routes that use that interface โ if routes that would use that interface get learned by the router, those routes MUST be evaluated along with all the other learned routes, and the router MUST decide which routes go into the forwarding database ๐ง for more on how that decision gets made, the implementor is referred to Chapter [7], Application Layer - Routing Protocols ๐
a router SHOULD speed up sending new routing information to all the routers it normally exchanges routing information with โก
5.3.13 IP Options ๐งฉ
options like Record Route and Timestamp contain slots where a router puts its address when it forwards the packet ๐ but each option has a limited number of slots, so a router might find there's no free slot to put its address in ๐ฌ no requirement below should be read as making a router insert its address into an option that has no slot left ๐ โโ๏ธ Section [5.2.5] talks about how a router must choose which of its addresses to put into an option ๐ฏ
5.3.13.1 Unrecognized Options
unrecognized IP options in forwarded packets MUST be passed through unchanged ๐ซถโจ
5.3.13.2 Security Option ๐
Some environments want the Security option in every packet ๐ก๏ธ but that's outside the scope of this doc and the IP standard spec. ngl, the security options in [INTERNET:1] and [INTERNET:16] are obsolete ๐ so the move is the revised one in [INTERNET:5]. Routers SHOULD IMPLEMENT the revised security option described in [INTERNET:5] โจ
DISCUSSION ๐ญ Routers meant for networks with multiple security levels should support packet filtering based on IPSO (RFC-1108) labels ๐ท๏ธ To make that work, the admin needs to be able to configure both a lower sensitivity limit (e.g. Unclassified) and an upper sensitivity limit (e.g. Secret) on each interface. It's common, but not always the case, that the two limits are the same (e.g. a single-level interface) ๐ง Packets caught by an IPSO filter as out of range should be silently dropped, and a counter should note how many packets got dropped because of out-of-range IPSO labels ๐
5.3.13.3 Stream Identifier Option ๐
This option is obsolete ๐ If the Stream Identifier option is present in a packet forwarded by the router, the option MUST be ignored and passed through unchanged ๐ซถ
5.3.13.4 Source Route Options ๐บ๏ธ
A router MUST implement support for source route options in forwarded packets ๐ A router MAY implement a configuration option that, when enabled, causes all source-routed packets to be discarded. However, such an option MUST NOT be enabled by default ๐ โโ๏ธ
DISCUSSION ๐ญ Being able to source route datagrams through the Internet is actually important for network diagnostic tools ๐ง But source routing can also be used to bypass administrative and security controls inside a network. Specifically, if someone uses manipulated routing tables to provide administrative separation instead of other methods like packet filtering, those setups may be vulnerable through source routed packets ๐ญ
EDITORS+COMMENTS ๐ Packet filtering can be defeated by source routing too, if it's applied in any router except one on the final leg of the source routed path ๐ซฃ Neither route nor packet filters are a complete security solution. Not me thinking one tool is enough ๐
5.3.13.5 Record Route Option ๐ค๏ธ
Routers MUST support the Record Route option in forwarded packets ๐ธ
A router MAY provide a configuration option that, if enabled, causes the router to ignore (i.e., pass through unchanged) Record Route options in forwarded packets. If provided, such an option MUST default to enabling the record-route. This option should not affect the processing of Record Route options in datagrams received by the router itself (in particular, Record Route options in ICMP echo requests will still be processed according to Section [4.3.3.6]) ๐
DISCUSSION ๐ญ Some people believe Record Route is a security problem because it reveals info about the network's topology ๐ So this doc lets it be disabled. Iconic behavior, respectfully ๐ฆ
5.3.13.6 Timestamp Option โฐ
Routers MUST support the timestamp option in forwarded packets โฑ๏ธ A timestamp value MUST follow the rules given [INTRO:2] ๐
If the flags field = 3 (timestamp and prespecified address), the router MUST add its timestamp if the next prespecified address matches any of the router's IP addresses. The prespecified address does not have to be the address of the interface the packet arrived on, or the address of the interface it will be sent over ๐ง
IMPLEMENTATION ๐ ๏ธ To get the most out of the timestamps in the timestamp option, it's suggested that the timestamp inserted be, as nearly as practical, the time the packet arrived at the router โณ For datagrams originated by the router, the timestamp inserted should be, as nearly as practical, the time the datagram was passed to the network layer for transmission ๐
A router MAY provide a configuration option which, if enabled, causes the router to ignore (i.e., pass through unchanged) Timestamp options in forwarded datagrams when the flag word is set to 0 (timestamps only) or 1 (timestamp and registering IP address). If provided, such an option MUST default to off (that is, the router does not ignore the timestamp). This option should not affect the processing of Timestamp options in datagrams received by the router itself. In particular, a router will insert timestamps into Timestamp options in datagrams received by the router, and Timestamp options in ICMP echo requests will still be processed according to Section [4.3.3.6] โจ
DISCUSSION ๐ญ Like Record Route, the Timestamp option can reveal stuff about a network's topology ๐ Some people consider that a security concern, and that's valid ngl ๐ซถ
6. TRANSPORT LAYER ๐
A router is not required to implement any Transport Layer protocols except those needed to support the Application Layer protocols the router supports. In practice, most routers end up implementing both the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP) ๐
6.1 USER DATAGRAM PROTOCOL - UDP ๐
The User Datagram Protocol (UDP) is specified in [TRANS:1] ๐ฆ
A router that implements UDP MUST be compliant, and SHOULD be unconditionally compliant, with the requirements of [INTRO:2], except that:
- This specification does not specify the interfaces between the various protocol layers. So a router's interfaces don't need to comply with [INTRO:2], except where compliance is required for proper functioning of Application Layer protocols the router supports ๐งฉ
- Contrary to [INTRO:2], an application SHOULD NOT disable generation of UDP checksums ๐ โโ๏ธ
DISCUSSION ๐ญ Even if a particular application protocol needs received UDP datagrams to contain a UDP checksum, there's no general requirement that received UDP datagrams contain UDP checksums ๐คทโโ๏ธ Of course, if a UDP checksum is present in a received datagram, the checksum must be verified, and the datagram discarded if the checksum is incorrect โ
6.2 TRANSMISSION CONTROL PROTOCOL - TCP ๐งต
The Transmission Control Protocol (TCP) is specified in [TRANS:2] ๐
A router that implements TCP MUST be compliant, and SHOULD be unconditionally compliant, with the requirements of [INTRO:2], except that:
- This specification does not specify the interfaces between the various protocol layers. So a router need not comply with the following requirements of [INTRO:2] (except of course where compliance is required for proper functioning of Application Layer protocols the router supports):
- Use of Push: RFC-793 Section 2.8: Passing a received PSH flag to the application layer is now OPTIONAL. ๐ซง
- Urgent Pointer: RFC-793 Section 3.1: A TCP MUST inform the application layer asynchronously whenever it receives an Urgent pointer and there was previously no pending urgent data, or whenever the Urgent pointer advances in the data stream. There MUST be a way for the application to learn how much urgent data remains to be read from the connection, or at least to determine whether or not more urgent data remains to be read. ๐จ
- TCP Connection Failures: An application MUST be able to set the value for
R2for a particular connection. For example, an interactive application might setR2to ``infinity,'' giving the user control over when to disconnect. ๐๏ธ - TCP Multihoming: If an application on a multihomed host does not specify the local IP address when actively opening a TCP connection, then the TCP MUST ask the IP layer to select a local IP address before sending the (first) SYN. See the function
GET_SRCADDR()in Section 3.4. ๐ - IP Options: An application MUST be able to specify a source route when it actively opens a TCP connection, and this MUST take precedence over a source route received in a datagram. ๐บ๏ธ
- For similar reasons, a router need not comply with any of the requirements of [INTRO:2] ๐ซถ
- The requirements concerning the Maximum Segment Size Option in [INTRO:2] are amended as follows: a router that implements the host portion of MTU discovery (discussed in Section [4.2.3.3] of this memo) uses
536as the default value ofSendMSSonly if the path MTU is unknown. If the path MTU is known, the default value forSendMSSis the path MTU - 40 ๐ - The requirements concerning the Maximum Segment Size Option in [INTRO:2] are amended as follows: ICMP Destination Unreachable codes
11and12are additional soft error conditions. Therefore, these message MUST NOT cause TCP to abort a connection. ๐ช
DISCUSSION ๐ญ It's worth noting in particular that a TCP implementation in a router must conform to the following requirements of [INTRO:2]:
- Providing a configurable TTL. [Time to Live: RFC-793 Section 3.9] โณ
- Providing an interface to configure keep-alive behavior, if keep-alives are used at all. [TCP Keep-Alives] ๐
- Providing an error reporting mechanism, and the ability to manage it. [Asynchronous Reports] ๐ฃ
- Specifying type of service. [Type-of-Service] ๐
The general paradigm here is that if a particular interface is visible outside the router, then all requirements for that interface must be followed. For example, if a router provides a telnet function, it's generating traffic that's likely to be routed in external networks. So it has to be able to set the type of service correctly, or else the telnet traffic may not get through ๐ฆ
7. APPLICATION LAYER - ROUTING PROTOCOLS ๐บ๏ธโจ
7.1 INTRODUCTION ๐
For technical, managerial, and sometimes political reasons, the Internet routing system has two components: interior routing and exterior routing ๐ The concept of an Autonomous System (AS), as defined in Section 2.2.4 of this document, plays a key role in separating interior from exterior routing. It's what lets us delineate the set of routers where the switch from interior to exterior routing happens ๐ง An IP datagram may have to traverse the routers of two or more Autonomous Systems to reach its destination, and the Autonomous Systems must provide each other with topology information to allow that forwarding ๐ซถ Interior gateway protocols (IGPs) distribute routing information within an AS (i.e., intra-AS routing) ๐ Exterior gateway protocols exchange routing information among ASs (i.e., inter-AS routing) ๐
7.1.1 Routing Security Considerations
okay bestie, routing is one of the very few places where the Robustness Principle (be liberal in what you accept) does not apply ๐ โโ๏ธ๐ฅ routers should be pretty suspicious about accepting routing data from other routing systems. trust nobody, babe ๐
A router SHOULD provide the ability to rank routing information sources from most trustworthy to least trustworthy, and to accept routing information about any particular destination from the most trustworthy sources first โจ this was kinda implied in the original core/stub autonomous system model that used EGP and various interior routing protocols. it matters even more now that the central, trusted core is gone ๐ฅบ
A router SHOULD provide a mechanism to filter out obviously invalid routes (such as those for net 127) ๐
Routers MUST NOT by default redistribute routing data they do not themselves use, trust or otherwise consider valid ๐ซ in rare cases it may be necessary to redistribute suspicious information, but that should only happen under direct intercession by some human agency ๐งโ๐ป
routers must be at least a little paranoid about accepting routing data from anyone, and they must be especially careful when they distribute routing information that was given to them by another party ๐ see below for specific guidelines ๐
7.1.2 Precedence
unless the specification for a particular routing protocol says otherwise, a router SHOULD set the IP Precedence value for IP datagrams carrying routing traffic it originates to 6 (INTERNETWORK CONTROL) ๐
DISCUSSION
Routing traffic with VERY FEW exceptions should be the highest precedence traffic on any network ๐ญ if a system's routing traffic can't get through, chances are nothing else will either ๐
7.1.3 Message Validation
peer-to-peer authentication involves several tests ๐ซถ message passwords and explicit acceptable neighbor lists have, in the past, made the route database way more robust ๐ Routers SHOULD IMPLEMENT management controls that let you explicitly list valid routing neighbors โจ Routers SHOULD IMPLEMENT peer-to-peer authentication for those routing protocols that support it ๐
Routers SHOULD validate routing neighbors based on their source address and the interface a message is received on ๐ฆ neighbors on a directly attached subnet SHOULD be restricted to talking to the router via the interface that subnet is posited on, or via unnumbered interfaces. messages received on other interfaces SHOULD be silently discarded ๐คซ
DISCUSSION
security breaches and a whole bunch of routing problems get avoided by this basic testing ๐ก๏ธโจ
7.2 INTERIOR GATEWAY PROTOCOLS
7.2.1 INTRODUCTION
an Interior Gateway Protocol (IGP) is used to distribute routing information between the various routers in a particular AS ๐ธ no matter what algorithm an IGP uses, it should do the following things:
- Respond quickly to changes in the internal topology of an AS โก
- Provide a mechanism such that circuit flapping does not cause continuous routing updates ๐
- Provide quick convergence to loop-free routing ๐ง
- Utilize minimal bandwidth ๐
- Provide equal cost routes to enable load-splitting โ๏ธ
- Provide a means for authentication of routing updates ๐
current IGPs on the internet today are characterized as either being based on a distance-vector or a link-state algorithm ๐ค
several IGPs are detailed in this section, including the ones most commonly used and some newer protocols that may be widely used in the future ๐ฎ there are also loads of other protocols for intra-AS routing out there in the Internet community, so this isn't everything ๐
A router that implements any routing protocol (other than static routes) MUST IMPLEMENT OSPF (see Section [7.2.2]) ๐ A router MAY implement additional IGPs โจ
7.2.2 OPEN SHORTEST PATH FIRST - OSPF
Shortest Path First (SPF) based routing protocols are a class of link-state algorithms built on Dijkstra's shortest-path algorithm ๐ง SPF algorithms have been around since the ARPANET started, but they only recently got popular inside both the IP and the OSI communities ๐ฅน in an SPF based system, each router grabs the entire topology database through a process called flooding. flooding insures a reliable transfer of the information ๐ฌ then each router runs the SPF algorithm on its database to build the IP routing table ๐บ๏ธ the OSPF routing protocol is an implementation of an SPF algorithm. the current version, OSPF version 2, is specified in [ROUTE:1]. note that RFC-1131, which describes OSPF version 1, is obsolete ๐๏ธ
note that to comply with Section [8.3] of this memo, a router that implements OSPF MUST IMPLEMENT the OSPF MIB [MGT:14] ๐
7.2.3 INTERMEDIATE SYSTEM TO INTERMEDIATE SYSTEM - DUAL IS-IS
the American National Standards Institute (ANSI) X3S3.3 committee defined an intra-domain routing protocol ๐๏ธ it's called Intermediate System to Intermediate System Routeing Exchange Protocol ๐ฅฐ
its application to an IP network is defined in [ROUTE:2], and it's known as Dual IS-IS (or sometimes Integrated IS-IS) ๐ IS-IS is based on a link-state (SPF) routing algorithm and shares all the advantages of that class of protocols ๐
7.3 EXTERIOR GATEWAY PROTOCOLS
7.3.1 INTRODUCTION
Exterior Gateway Protocols are used for inter-Autonomous System routing ๐ they exchange reachability information for a set of networks internal to a particular autonomous system with a neighboring autonomous system ๐ค
the area of inter-AS routing is a hot research topic inside the Internet Engineering Task Force ๐ฌ the Exterior Gateway Protocol (EGP) described in Section [Appendix F.1] was the inter-AS protocol of choice for a long time, but it's historical now ๐ฐ๏ธ the Border Gateway Protocol (BGP) gets rid of a lot of EGP's restrictions and limitations, so it's growing super fast in popularity ๐ a router is not required to implement any inter-AS routing protocol. however, if a router does implement EGP, it also MUST IMPLEMENT BGP ๐ even though RIP (described in Section [7.2.4]) wasn't designed as an exterior gateway protocol, it's sometimes used for inter-AS routing anyway ๐
7.3.2 BORDER GATEWAY PROTOCOL - BGP
7.3.2.1 Introduction
The Border Gateway Protocol (BGP-4) is an inter-AS routing protocol that swaps network reachability information with other BGP speakers ๐ฃ๏ธ the information for a network includes the complete list of ASs that traffic has to transit to reach that network ๐ฆ this lets you insure loop-free paths. the info is also enough to build a graph of AS connectivity, so routing loops can be pruned and some policy decisions can be enforced at the AS level ๐งฉ
BGP is defined by [ROUTE:4]. [ROUTE:5] specifies the proper usage of BGP on the Internet, and gives some handy implementation hints and guidelines ๐ [ROUTE:12] and [ROUTE:13] have more useful info ๐ค
To comply with Section [8.3] of this memo, a router that implements BGP is required to implement the BGP MIB [MGT:15] ๐
to figure out what policy decisions you can enforce with BGP, you have to focus on the rule that an AS only advertises the routes it actually uses to its neighbor ASs ๐ฏ this rule reflects the hop-by-hop routing paradigm used pretty much everywhere on the current Internet ๐ some policies can't be supported by hop-by-hop routing, so they need techniques like source routing to enforce ๐ โโ๏ธ for example, BGP doesn't let one AS send traffic to a neighbor AS and have that traffic take a different route from the one taken by traffic that started in the neighbor AS ๐ค on the flip side, BGP can support any policy that fits the hop-by-hop routing paradigm ๐ฅณ
implementors of BGP are strongly encouraged to follow the recommendations outlined in Section 6 of [ROUTE:5] ๐ซถ
7.3.2.2 Protocol Walk-through
BGP supports pretty complex routing policies (see Section 4.2 in [ROUTE:5] for an example), but not every BGP implementor has to support those ๐ฅฑ at a minimum, though, a BGP implementation:
- SHOULD allow an AS to control announcements of the BGP learned routes to adjacent AS's. Implementations SHOULD support such control with at least the granularity of a single network. Implementations SHOULD also support such control with the granularity of an autonomous system, where that autonomous system may be either the one that originated the route, or the one that advertised the route to the local system (the adjacent autonomous system) ๐ฃ
- SHOULD allow an AS to prefer a particular path to a destination (when more than one path is available). This SHOULD be done by letting the system administrator assign weights to Autonomous Systems, and making the route selection process pick the route with the lowest weight (where a route's weight is the sum of the weights of all the AS's in the AS_PATH path attribute for that route) โ๏ธ
- SHOULD allow an AS to ignore routes with certain AS's in the AS_PATH path attribute. You can do this with the technique outlined in (2) by assigning infinity as the weight for those AS's. the route selection process must ignore routes that have a weight equal to infinity ๐ซโพ๏ธ
7.3.3 INTER-AS ROUTING WITHOUT AN EXTERIOR PROTOCOL
it's possible to exchange routing information between two autonomous systems or routing domains without using a standard exterior routing protocol, by running two separate, standard interior routing protocols ๐ the most common way to do this is to run both interior protocols independently in one of the border routers, with an exchange of route information between the two processes ๐งโ๐คโ๐ง
just like exchanging info from an EGP to an IGP, these exchanges between two IGPs in a single router can create routing loops if you don't have appropriate controls in place ๐ฌ๐
7.4 STATIC ROUTING ๐งญโจ
Okay bestie, static routing is giving "I'm in control" energy ๐ It's how you tell a router exactly which next hop to use for a destination, no guessing ๐ A router SHOULD give you a way to define a static route to a destination, where that destination is a network prefix ๐ธ The mechanism SHOULD also let you set a metric for each static route ๐
A router that runs a dynamic routing protocol MUST let you define static routes with any metric that's valid for that protocol ๐ It also MUST give the user a way to list static routes that may or may not get pushed out through the routing protocol ๐ฆ On top of that, a router SHOULD support the following extra info if it runs a routing protocol that could actually use it ๐ซถ
- TOS,
- Subnet Mask, or
- Prefix Length, or
- A metric specific to a given routing protocol that can import the route.
DISCUSSION ๐ญ We intend that you only need to support the stuff that's useful to the routing protocol you're using ๐ The need for TOS shouldn't force the vendor to build the other parts if nobody's using them ๐
Whether a router prefers a static route over a dynamic one (or the other way around), or whether the metrics get used to pick between conflicting static and dynamic routes, SHOULD be configurable for each static route โ๏ธ
A router MUST allow a metric to be assigned to a static route for each routing domain that it supports. Each such metric MUST be explicitly assigned to a specific routing domain. For example:
route 10.0.0.0/8 via 192.0.2.3 rip metric 3
route 10.21.0.0/16 via 192.0.2.4 ospf inter-area metric 27
route 10.22.0.0/16 via 192.0.2.5 egp 123 metric 99
DISCUSSION ๐ญ It's been suggested that, ideally, static routes should have preference values instead of metrics ๐ฅบ (Metrics can only be compared with metrics from other routes in the same routing domain, so a static route's metric could only be compared with other static routes' metrics.) But this is contrary to some current implementations, where static routes really do have metrics, and those metrics decide whether a dynamic route overrides the static route to the same destination ๐คทโโ๏ธ So this document uses the term metric rather than preference ๐
This technique basically turns the static route into a RIP route, or an OSPF route (or whatever, depending on the domain of the metric) ๐ฅ So the route lookup algorithm of that domain applies. However, this is not route leaking ๐ โโ๏ธ Coercing a static route into a dynamic routing domain does not authorize the router to redistribute the route into that dynamic routing domain ๐ซ
For static routes that aren't put into a specific routing domain, the route lookup algorithm is:
(1) Basic match
(2) Longest match
(3) Weak TOS (if TOS supported)
(4) Best metric (where metric are implementation-defined)
The last step may not be necessary, but it's super useful when you want a primary static route over one interface and a secondary static route over an alternate interface ๐ That way you get failover to the alternate path if the interface for the primary route fails ๐ฆ
7.5 FILTERING OF ROUTING INFORMATION ๐ช
Each router in a network makes forwarding decisions based on the information in its forwarding database ๐๏ธ In a simple network, the contents of that database may be configured statically. As the network grows more complex, dynamic updating of the forwarding database becomes critical to the network running efficiently ๐
If data flow through a network is going to be as efficient as possible, there needs to be a mechanism for controlling how the information a router uses to build its forwarding database gets propagated ๐ฐ This control looks like choosing which sources of routing information to trust and selecting which pieces of that information to believe โ The resulting forwarding database is a filtered version of the available routing information ๐
On top of efficiency, controlling how routing information propagates can reduce instability by stopping the spread of incorrect or bad routing information ๐
In some cases, local policy may require that complete routing information not be widely propagated ๐คซ
These filtering requirements apply only to non-SPF-based protocols (and therefore not at all to routers that don't implement any distance vector protocols) ๐ง
7.5.1 Route Validation ๐
A router SHOULD log as an error any routing update advertising a route that violates the specifications of this memo, unless the routing protocol that the update came from uses those values to encode special routes (such as default routes) ๐จ
7.5.2 Basic Route Filtering ๐งน
Filtering routing information lets you control which paths a router uses to forward the packets it receives ๐ฃ๏ธ A router should be selective about which sources of routing information it listens to and which routes it believes ๐ So a router MUST provide the ability to specify:
- On which logical interfaces routing information will be accepted, and which routes will be accepted from each logical interface.
- Whether all routes or only a default route is advertised on a logical interface.
Some routing protocols don't recognize logical interfaces as a source of routing information ๐ In those cases, the router MUST provide the ability to specify:
- from which other routers routing information will be accepted.
Here's an example ๐งธ Say a router connects one or more leaf networks to the main portion (or backbone) of a larger network. Since each leaf network has only one path in and out, the router can simply send a default route to them ๐ก It advertises the leaf networks to the main network ๐
7.5.3 Advanced Route Filtering ๐ธ๏ธ
As the topology of a network grows more complex, the need for more complex route filtering shows up ๐ So a router SHOULD provide the ability to specify, independently for each routing protocol:
- Which logical interfaces or routers' routing information (routes) will be accepted from, and which routes will be believed from each other router or logical interface,
- Which routes will be sent via which logical interface(s), and
- Which routers' routing information will be sent to, if this is supported by the routing protocol in use.
In many situations, it's desirable to assign a reliability ordering to routing information received from another router, instead of the simple believe or don't believe choice in the first bullet above ๐ฅ A router MAY provide the ability to specify:
- A reliability or preference to be assigned to each route received. A route with higher reliability will be chosen over one with lower reliability, regardless of the routing metric associated with each route.
If a router supports assigning preferences, the router MUST NOT propagate any routes it does not prefer as first party information ๐ซ If the routing protocol used to propagate the routes doesn't support distinguishing between first and third party information, the router MUST NOT propagate any routes it does not prefer ๐ โโ๏ธ
DISCUSSION ๐ญ For example, say a router receives a route to network C from router R, and a route to the same network from router S ๐ฏ If router R is considered more reliable than router S, traffic destined for network C will be forwarded to router R, regardless of the route received from router S ๐ฏ
Routing information for routes the router doesn't use (router S in the example above) MUST NOT be passed to any other router ๐ค
7.6 INTER-ROUTING-PROTOCOL INFORMATION EXCHANGE ๐
Routers MUST be able to exchange routing information between separate IP interior routing protocols, if independent IP routing processes can run in the same router ๐ Routers MUST provide some mechanism for avoiding routing loops when routers are configured for bi-directional exchange of routing information between two separate interior routing processes ๐ Routers MUST provide some priority mechanism for choosing routes from independent routing processes ๐ Routers SHOULD provide administrative control of IGP-IGP exchange when it's used across administrative boundaries ๐งฑ
Routers SHOULD provide some mechanism for translating or transforming metrics on a per network basis ๐ง Routers (or routing protocols) MAY allow for global preference of exterior routes imported into an IGP ๐
DISCUSSION ๐ญ Different IGPs use different metrics, so you need some translation technique when you bring information from one protocol into another protocol with a different form of metric ๐งฉ Some IGPs can run multiple instances within the same router or set of routers ๐คนโโ๏ธ In that case, metric information can be preserved exactly or translated โจ
There are at least two techniques for translation between different routing processes ๐ช The static (or reachability) approach uses the existence of a route advertisement in one IGP to generate a route advertisement in the other IGP with a given metric ๐ฃ The translation (or tabular) approach uses the metric in one IGP to create a metric in the other IGP, either through a function (such as adding a constant) or through a table lookup ๐
Bi-directional exchange of routing information is dangerous without control mechanisms to limit feedback ๐ฌ It's the same problem that distance vector routing protocols have to solve with the split horizon technique, and that EGP solves with the third-party rule ๐ Routing loops can be avoided explicitly through tables or lists of permitted or denied routes, or implicitly through a split horizon rule, a no-third-party rule, or a route tagging mechanism ๐ท๏ธ Vendors are encouraged to use implicit techniques where possible, to make administration easier for network operators ๐ซถ
8. APPLICATION LAYER - NETWORK MANAGEMENT PROTOCOLS ๐
Note that this chapter supersedes any requirements stated under "REMOTE MANAGEMENT" in [INTRO:3] ๐
8.1 The Simple Network Management Protocol - SNMP ๐
8.1.1. SNMP Protocol Elements ๐
Okay bestie, routers MUST be manageable by SNMP [MGT:3] ๐. SNMP MUST run over UDP/IP as its transport and network protocols ๐ฆ. Others MAY be supported too (see [MGT:25, MGT:26, MGT:27, and MGT:28]) โจ. SNMP management operations MUST work as if SNMP were implemented on the router itself. Specifically, management operations MUST be done by sending SNMP management requests to any of the IP addresses on any of the router's interfaces ๐ธ. The actual management operation may be performed by the router or by a proxy for the router ๐ .
Discussion This wording lets management happen by proxy, where the proxy answers SNMP packets that have one of the router's IP addresses in the destination address field. It also covers SNMP running directly on the router, receiving packets and responding properly ๐. It's super important that you can send management operations to one of the router's IP addresses! When you're debugging a network, the only thing that identifies the router might be one of its IP addresses, maybe spotted by peeking at another router's routing table ๐ฅ.
All SNMP operations (get, get-next, get-response, set, and trap) MUST be implemented ๐ฏ.
Routers MUST provide a mechanism for rate-limiting the generation of SNMP trap messages ๐. Routers MAY provide this mechanism through the asynchronous alert management algorithms described in [MGT:5] ๐ง.
Discussion Everyone agrees traps need rate-limiting, but there's no consensus yet on the best way to do it. The reference cited is considered experimental ๐คทโโ๏ธ.
8.2. Community Table
For the purposes of this spec, we pretend there's an abstract community table in the router ๐. It has several entries, one for each community, and each entry holds the parameters needed to fully define that community's attributes. How the table is actually implemented is totally up to the implementation ๐งฉ.
A router's community table MUST allow for at least one entry and SHOULD allow for at least two entries ๐.
Discussion A community table with zero capacity is useless. The router won't recognize any communities, so every SNMP operation gets rejected ๐. One entry is the minimal useful size. Two entries let one be read-only while the other has write capabilities ๐.
Routers MUST allow the user to manually (i.e., without using SNMP) examine, add, delete, and change entries in the SNMP community table ๐ ๏ธ. The user MUST be able to set the community name or construct a MIB view ๐. The user MUST be able to configure communities as read-only (i.e., no SETs allowed) or read-write (i.e., SETs allowed) ๐.
The user MUST be able to define at least one IP address for notifications to be sent to, for each community or MIB view, if traps are used ๐ฌ. These addresses SHOULD be definable on a community or MIB view basis. It SHOULD also be possible to enable or disable notifications on a community or MIB view basis ๐.
A router SHOULD provide the ability to specify a list of valid network managers for any particular community ๐. If that's enabled, a router MUST validate the source address of the SNMP datagram against the list, and MUST discard the datagram if its address doesn't appear on it ๐ซ. If the datagram gets discarded, the router MUST take all actions appropriate to an SNMP authentication failure ๐ญ.
Discussion This is a pretty limited authentication system, but paired with various forms of packet filtering it may give a little extra security ๐.
The community table MUST be saved in non-volatile storage ๐พ.
The initial state of the community table SHOULD contain one entry, with the community name string public and read-only access ๐. The default state of this entry MUST NOT send traps ๐
โโ๏ธ. If it's implemented, this entry MUST stay in the community table until the administrator changes or deletes it ๐.
Discussion By default, traps aren't sent to this community. Trap PDUs go to unicast IP addresses, and that address has to be configured into the router somehow. Before configuration happens, there's no such address, so who would the trap even go to? That's why trap sending to the public community defaults to disabled. An administrator can change this once the router is operational ๐ธ.
8.3. Standard MIBS
All MIBS relevant to a router's configuration are to be implemented, to wit: ๐
- The System, Interface, IP, ICMP, and UDP groups of MIB-II [MGT:2] MUST be implemented.
- The Interface Extensions MIB [MGT:18] MUST be implemented.
- The IP Forwarding Table MIB [MGT:20] MUST be implemented.
- If the router implements TCP (e.g., for Telnet) then the TCP group of MIB-II [MGT:2] MUST be implemented.
- If the router implements EGP then the EGP group of MIB-II [MGT:2] MUST be implemented.
- If the router supports OSPF then the OSPF MIB [MGT:14] MUST be implemented.
- If the router supports BGP then the BGP MIB [MGT:15] MUST be implemented.
- If the router has Ethernet, 802.3, or StarLan interfaces then the Ethernet-Like MIB [MGT:6] MUST be implemented.
- If the router has 802.4 interfaces then the 802.4 MIB [MGT:7] MUST be implemented.
- If the router has 802.5 interfaces then the 802.5 MIB [MGT:8] MUST be implemented.
- If the router has FDDI interfaces that implement ANSI SMT 7.3 then the FDDI MIB [MGT:9] MUST be implemented.
- If the router has FDDI interfaces that implement ANSI SMT 6.2 then the FDDI MIB [MGT:29] MUST be implemented.
- If the router has interfaces that use V.24 signalling, such as RS-232, V.10, V.11, V.35, V.36, or RS-422/423/449, then the RS-232 [MGT:10] MIB MUST be implemented.
- If the router has T1/DS1 interfaces then the T1/DS1 MIB [MGT:16] MUST be implemented.
- If the router has T3/DS3 interfaces then the T3/DS3 MIB [MGT:17] MUST be implemented.
- If the router has SMDS interfaces then the SMDS Interface Protocol MIB [MGT:19] MUST be implemented.
- If the router supports PPP over any of its interfaces then the PPP MIBs [MGT:11], [MGT:12], and [MGT:13] MUST be implemented.
- If the router supports RIP Version 2 then the RIP Version 2 MIB [MGT:21] MUST be implemented.
- If the router supports X.25 over any of its interfaces then the X.25 MIBs [MGT:22, MGT:23 and MGT:24] MUST be implemented.
8.4. Vendor Specific MIBS
The Internet Standard and Experimental MIBs don't cover the whole range of statistical, state, configuration, and control info that a network element might have ๐ค. That info is still super useful! So vendors of routers (and other network devices) have generally built MIB extensions to cover it. These are called Vendor Specific MIBs โจ.
The Vendor Specific MIB for the router MUST provide access to all statistical, state, configuration, and control information that isn't available through the Standard and Experimental MIBs that have been implemented ๐. This information MUST be available for both monitoring and control operations ๐๏ธ.
Discussion The goal here is that you can do anything on the router through SNMP that you can do through a console, and vice versa ๐. A certain minimal amount of configuration has to happen before SNMP can work at all (e.g., the router must have an IP address). That initial config can not be done through SNMP. But once it's done, full capabilities ought to be available through network management ๐ง .
The vendor SHOULD make available the specifications for all Vendor Specific MIB variables ๐. These specifications MUST conform to the SMI [MGT:1], and the descriptions MUST be in the form specified in [MGT:4] ๐.
Discussion Making the Vendor Specific MIB available is a must, because without it users couldn't configure their network management systems to access the vendor parameters, and those parameters would be totally useless ๐ญ. The format of the MIB specification is specified too! Parsers that read MIB specs and generate the tables the network management station needs do exist ๐ ๏ธ. They generally only understand the standard MIB spec format, though ๐.
8.5. Saving Changes
Parameters altered by SNMP MAY be saved to non-volatile storage ๐พ.
Discussion Reasons why this requirement is a MAY:
- The exact physical nature of non-volatile storage isn't specified in this document ๐คทโโ๏ธ. So parameters could be saved in NVRAM/EEPROM, a local floppy or hard disk, or a TFTP file server or BOOTP server, etc. Say the info lives in a file retrieved through TFTP. Then a change made to a config parameter on the router would need to be propagated back to the file server holding the config file. Or the SNMP operation would need to be directed at the file server, and then the change somehow pushed to the router. The answer to that doesn't seem obvious ๐.
This also puts more requirements on the host holding the config info than just having a TFTP server available, so much more that it's probably unsafe for a vendor to assume every potential customer has a suitable host ready ๐ฌ.
- The timing of committing changed parameters to non-volatile storage is still up for debate โณ. Some folks want every change committed immediately. Others want changes committed only on an explicit command ๐โโ๏ธ.
9. APPLICATION LAYER - MISCELLANEOUS PROTOCOLS ๐ง
For all additional application protocols that a router implements, the router MUST be compliant and SHOULD be unconditionally compliant with the relevant requirements of [INTRO:3] ๐.
9.1. BOOTP ๐ท
9.1.1. Introduction
The Bootstrap Protocol (BOOTP) is a UDP/IP-based protocol that lets a booting host configure itself dynamically and without user supervision ๐. It tells a host its assigned IP address, the IP address of a boot server host, and the name of a file to be loaded into memory and executed ([APPL:1]) ๐. Other config info, like the local prefix length or subnet mask, the local time offset, the addresses of default routers, and the addresses of various Internet servers, can also be passed to a host using BOOTP ([APPL:2]) ๐.
9.1.2 BOOTP Relay Agents
okay so bestie, BOOTP clients and their BOOTP server(s) are often NOT on the same IP (sub)network ๐ญ which means somebody in the middle has to pass BOOTP messages back and forth. That somebody is a third-party agent, and it used to be called a BOOTP forwarding agent. But that name got confusing next to a router's IP forwarding function, so now it's the BOOTP relay agent ๐ฆ
DISCUSSION
A BOOTP relay agent does a totally different job from a router's normal IP forwarding ๐ A router usually just switches IP datagrams between networks pretty transparently. A BOOTP relay agent is more like the final destination: it receives BOOTP messages and then generates new BOOTP messages because of them. So you have to resist the urge to just forward a BOOTP message straight through like it's a regular packet ๐ โโ๏ธ
This relay-agent functionality is most conveniently placed in the routers that connect the clients and servers ๐ธ It can also live in a host that's directly connected to the client (sub)net, if that works better.
A router MAY provide BOOTP relay-agent capability ๐ If it does, it MUST conform to the specifications in [APPL:3].
Section [5.2.3] talked about when a packet gets delivered locally (to the router). Every locally delivered UDP message whose UDP destination port number is BOOTPS (67) gets considered for special processing by the router's logical BOOTP relay agent ๐ง
Sections [4.2.2.11] and [5.3.7] covered invalid IP source addresses ๐ Under those rules, a router must not forward any received datagram whose IP source address is 0.0.0.0. BUT ๐จ routers that support a BOOTP relay agent MUST accept for local delivery to the relay agent BOOTREQUEST messages whose IP source address is 0.0.0.0. Yes, this is the one exception, and it's giving plot twist ๐ญโจ
10. OPERATIONS AND MAINTENANCE ๐
This chapter supersedes any requirements of [INTRO:3] relating to "Extensions to the IP Module." ๐
Operation and maintenance (O&M) facilities are an essential part of any router implementation ๐ซถ These functions don't seem to have much to do with interoperability on paper, but the network manager needs them to make the router interoperate, and to track down problems when it doesn't. This chapter also talks a bit about router initialization and about facilities that help network managers secure and account for their networks ๐
10.1 Introduction
Here's what counts as router O&M ๐
- Diagnosing hardware problems in the router's processor, in its network interfaces, or in its connected networks, modems, or communication lines.
- Installing new hardware
- Installing new software.
- Restarting or rebooting the router after a crash.
- Configuring (or reconfiguring) the router.
- Detecting and diagnosing Internet problems such as congestion, routing loops, bad IP addresses, black holes, packet avalanches, and misbehaved hosts. ๐
- Changing network topology, either temporarily (e.g., to bypass a communication line problem) or permanently.
- Monitoring the status and performance of the routers and the connected networks.
- Collecting traffic statistics for use in (Inter-)network planning.
- Coordinating the above activities with appropriate vendors and telecommunications specialists.
Routers and their connected communication lines are often run as a system by a centralized O&M organization ๐ข That organization may have a (Inter-)network operation center, or NOC, to handle its O&M work. It's essential that routers support remote control and monitoring from that NOC through an Internet path, because routers might not be on the same network as their NOC ๐ And since a network failure can temporarily cut off network access, many NOCs insist that routers be reachable for network management through another route. That's often dial-up modems hooked up to the routers' console ports ๐
An IP packet crossing an internet will often go through routers controlled by more than one NOC, so diagnosing an Internet problem will often take cooperation between people at more than one NOC ๐ค Sometimes the same router needs to be watched by more than one NOC, but only when it's actually necessary, because too much monitoring could hurt a router's performance ๐
The monitoring tools at a NOC can range a lot in sophistication ๐ Current ones include multi-window, dynamic displays of the entire router system. Using AI techniques for automatic problem diagnosis is proposed for the future ๐ง
Router O&M facilities are only a piece of the big, difficult problem of Internet management ๐ฎโ๐จ That problem involves not just multiple management organizations but also multiple protocol layers. For example, at the current stage of Internet architecture evolution, there's a strong coupling between host TCP implementations and eventual IP-level congestion in the router system [OPER:1] ๐คฏ So diagnosing congestion problems will sometimes require monitoring TCP statistics in hosts. There are a number of R&D efforts in progress in Internet management and, more specifically, router O&M right now. Those efforts have already produced standards for router O&M, and this is also an area where vendor creativity can make a big contribution ๐
10.2 Router Initialization
10.2.1 Minimum Router Configuration
There's a minimum set of conditions that must be met before a router may forward packets ๐ฆ A router MUST NOT enable forwarding on any physical interface unless either:
- The router knows the IP address and associated subnet mask or network prefix length of at least one logical interface associated with that physical interface, or
- The router knows that the interface is an unnumbered interface and knows its router-id.
These parameters MUST be explicitly configured:
- A router MUST NOT use factory-configured default values for its IP addresses, prefix lengths, or router-id, and
- A router MUST NOT assume that an unconfigured interface is an unnumbered interface.
DISCUSSION
Routers have actually shipped with vendor-installed default addresses on their interfaces ๐ณ In a few cases, that meant routers ended up advertising those default addresses into active networks. Yikes ๐
10.2.2 Address and Prefix Initialization
A router MUST allow its IP addresses and their address masks or prefix lengths to be statically configured and saved in non-volatile storage ๐พ
A router MAY obtain its IP addresses and their corresponding address masks dynamically as a side effect of the system initialization process (see Section 10.2.3]);
If the dynamic method is provided, the choice of method used in a particular router MUST be configurable โ๏ธ
As was described in Section [4.2.2.11], IP addresses are not allowed to have the value 0 or -1 in the <Host-number> or <Network-prefix> fields ๐
โโ๏ธ So a router SHOULD NOT let an IP address or address mask get set to a value that would make any of those fields have the value zero or -1.
DISCUSSION
Using arbitrary address masks can create situations where routing is ambiguous ๐ That's when two routes with different but equally specific subnet masks both match a particular destination address. This is one of the strongest arguments for using network prefixes, and it's the reason discontiguous subnet masks aren't permitted at all ๐
A router SHOULD make the following checks on any address mask it installs:
- The mask is neither all ones nor all zeroes (the prefix length is neither zero nor 32).
- The bits which correspond to the network prefix part of the address are all set to 1.
- The bits that correspond to the network prefix are contiguous.
DISCUSSION
Masks associated with routes are sometimes also called subnet masks, but this test should not be applied to them ๐ซ
10.2.3 Network Booting using BOOTP and TFTP
There's been a lot of discussion about how routers can and should be booted from the network ๐ฅน Those discussions have centered on BOOTP and TFTP. Right now, there are routers that boot with TFTP from the network. And there's no reason BOOTP couldn't be used to locate the server the boot image should be loaded from ๐งญ
BOOTP is a protocol for booting end systems, so using it with routers takes a little stretching ๐คธโโ๏ธ If a router is using BOOTP to locate the current boot host, it should send a BOOTP Request with its hardware address for its first interface. Or, if it's been configured some other way before, it should send either another interface's hardware address or another number to put in the hardware address field of the BOOTP packet ๐ข This is so routers without hardware addresses (like synchronous line only routers) can still use BOOTP for boot discovery. TFTP can then be used to retrieve the image found in the BOOTP Reply ๐ฆ If there are no configured interfaces or numbers to use, a router MAY cycle through the interface hardware addresses it has until the BOOTP server finds a match ๐
A router SHOULD IMPLEMENT the ability to store parameters learned through BOOTP in local non-volatile storage ๐ A router MAY implement the ability to store a system image loaded over the network into local stable storage.
A router MAY have a facility that lets a remote user request that the router get a new boot image ๐ธ And you should make a distinction between getting that new boot image from one of three places: the one included in the request, the last boot image server, or using BOOTP to locate a server.
10.3 Operation and Maintenance
10.3.1 Introduction
okay so there's a whole range of ways to do O&M (operations and maintenance) on a router ๐ At one end is the local-only model, where you can only do O&M functions locally, like from a terminal plugged straight into the router box ๐ At the other end is the fully remote model, where only the bare minimum is possible locally (think forcing a boot ๐) and basically everything else gets done remotely from the NOC. There are also in-between models, like one where NOC people can log into the router as a host over Telnet and do stuff that can also be done locally. ๐ง
The local-only model might be fine for a few installs, but honestly? Remote O&M from a NOC is usually required, so most routers need remote O&M provisions. no cap ๐ซถ
Remote O&M functions can be run through a control agent (a program) โจ In the direct approach, the router supports remote O&M itself straight from the NOC using standard Internet protocols (e.g., SNMP, UDP or TCP) ๐ฆ In the indirect approach, the control agent speaks those protocols and then controls the router with proprietary protocols instead. The direct approach is the fave ๐ but either one is acceptable. Using specialized host hardware and/or software that needs a big extra investment is discouraged ๐ Still, some vendors might decide to provide the control agent as an integrated part of the network the routers live in. If that's the case, it is required that there's a way to operate the control agent from a remote site, using Internet protocols and paths, with functionality equivalent to a local agent terminal. iconic energy ๐
It's desirable that the control agent and any other NOC software tools a vendor provides run as user programs on a standard operating system ๐ธ Using the standard Internet protocols UDP and TCP to talk to the routers should make that way easier. ๐
Remote monitoring and (especially!) remote control come with major access control problems that have to be addressed ๐ฅ You also have to be careful about controlling how much router resources these functions use. For example, it's not desirable to let router monitoring eat more than some limited fraction of the router's CPU time ๐ BUT O&M functions have to get priority so they can run when the router is congested, since that's often exactly when O&M is most needed. main character problems, frfr ๐ญ
10.3.2 Out Of Band Access
Routers MUST support Out-Of-Band (OOB) access. OOB access SHOULD provide the same functionality as in-band access. This access SHOULD implement access controls, to prevent unauthorized access. ๐
DISCUSSION This Out-Of-Band access will allow the NOC a way to access isolated routers during times when network access is not available. ๐ง
Out-Of-Band access is an important management tool for the network administrator. It allows the access of equipment independent of the network connections. There are many ways to achieve this access. Whichever one is used it is important that the access is independent of the network connections. An example of Out-Of-Band access would be a serial port connected to a modem that provides dial up access to the router. โ๏ธ
It is important that the OOB access provides the same functionality as in-band access. In-band access, or accessing equipment through the existing network connection, is limiting, because most of the time, administrators need to reach equipment to figure out why it is unreachable. In band access is still very important for configuring a router, and for troubleshooting more subtle problems. ๐
10.3.2 Router O&M Functions
10.3.2.1 Maintenance - Hardware Diagnosis
Each router SHOULD operate as a stand-alone device for the purposes of local hardware maintenance. Means SHOULD be available to run diagnostic programs at the router site using only on-site tools. A router SHOULD be able to run diagnostics in case of a fault. For suggested hardware and software diagnostics see Section [10.3.3]. ๐ ๏ธ
10.3.2.2 Control - Dumping and Rebooting
A router MUST include both in-band and out-of-band mechanisms to allow the network manager to reload, stop, and restart the router. A router SHOULD also contain a mechanism (such as a watchdog timer) which will reboot the router automatically if it hangs due to a software or hardware fault. โฐ
A router SHOULD IMPLEMENT a mechanism for dumping the contents of a router's memory (and/or other state useful for vendor debugging after a crash), and either saving them on a stable storage device local to the router or saving them on another host via an up-line dump mechanism such as TFTP (see [OPER:2], [INTRO:3]). ๐ฆ
10.3.2.3 Control - Configuring the Router
Every router has configuration parameters that may need to be set. It SHOULD be possible to update the parameters without rebooting the router; at worst, a restart MAY be required. There may be cases when it is not possible to change parameters without rebooting the router (for instance, changing the IP address of an interface). In these cases, care should be taken to minimize disruption to the router and the surrounding network. ๐
There SHOULD be a way to configure the router over the network either manually or automatically. A router SHOULD be able to upload or download its parameters from a host or another router. A means SHOULD be provided, either as an application program or a router function, to convert between the parameter format and a human-editable format. A router SHOULD have some sort of stable storage for its configuration. A router SHOULD NOT believe protocols such as RARP, ICMP Address Mask Reply, and MAY not believe BOOTP. ๐ โโ๏ธ
DISCUSSION It is necessary to note here that in the future RARP, ICMP Address Mask Reply, BOOTP and other mechanisms may be needed to allow a router to auto-configure. Although routers may in the future be able to configure automatically, the intent here is to discourage this practice in a production environment until auto-configuration has been tested more thoroughly. The intent is NOT to discourage auto-configuration all together. In cases where a router is expected to get its configuration automatically it may be wise to allow the router to believe these things as it comes up and then ignore them after it has gotten its configuration. ๐ง
10.3.2.4 Net Booting of System Software
A router SHOULD keep its system image in local non-volatile storage such as PROM, NVRAM, or disk. It MAY also be able to load its system software over the network from a host or another router.
A router that can keep its system image in local non-volatile storage MAY be configurable to boot its system image over the network. A router that offers this option SHOULD be configurable to boot the system image in its non-volatile local storage if it is unable to boot its system image over the network. ๐พ
DISCUSSION It is important that the router be able to come up and run on its own. NVRAM may be a particular solution for routers used in large networks, since changing PROMs can be quite time consuming for a network manager responsible for numerous or geographically dispersed routers. It is important to be able to netboot the system image because there should be an easy way for a router to get a bug fix or new feature more quickly than getting PROMs installed. Also if the router has NVRAM instead of PROMs, it will netboot the image and then put it in NVRAM. ๐
Routers SHOULD perform some basic consistency check on any image loaded, to detect and perhaps prevent incorrect images. ๐
A router MAY also be able to distinguish between different configurations based on which software it is running. If configuration commands change from one software version to another, it would be helpful if the router could use the configuration that was compatible with the software. ๐งฉ
10.3.2.5 Detecting and responding to misconfiguration
There MUST be mechanisms for detecting and responding to misconfigurations. If a command is executed incorrectly, the router SHOULD give an error message. The router SHOULD NOT accept a poorly formed command as if it were correct. ๐จ
DISCUSSION There are cases where it is not possible to detect errors: the command is correctly formed, but incorrect with respect to the network. This may be detected by the router, but may not be possible. ๐ค
Another form of misconfiguration is misconfiguration of the network to which the router is attached. A router MAY detect misconfigurations in the network. The router MAY log these findings to a file, either on the router or a host, so that the network manager will see that there are possible problems on the network. ๐
DISCUSSION Examples of such misconfigurations might be another router with the same address as the one in question or a router with the wrong address mask. If a router detects such problems it is probably not the best idea for the router to try to fix the situation. That could cause more harm than good. ๐
10.3.2.6 Minimizing Disruption
Changing the configuration of a router SHOULD have minimal affect on the network. Routing tables SHOULD NOT be unnecessarily flushed when a simple change is made to the router. If a router is running several routing protocols, stopping one routing protocol SHOULD NOT disrupt other routing protocols, except in the case where one network is learned by more than one routing protocol. ๐ท
DISCUSSION It is the goal of a network manager to run a network so that users of the network get the best connectivity possible. Reloading a router for simple configuration changes can cause disruptions in routing and ultimately cause disruptions to the network and its users. If routing tables are unnecessarily flushed, for instance, the default route will be lost as well as specific routes to sites within the network. This sort of disruption will cause significant downtime for the users. It is the purpose of this section to point out that whenever possible, these disruptions should be avoided. ๐ฆ
10.3.2.7 Control - Troubleshooting Problems ๐งโจ
(1) A router MUST provide in-band network access, but (except as required by Section [8.2]) for security reasons this access SHOULD be disabled by default. Vendors MUST document the default state of any in-band access. This access SHOULD implement access controls, to prevent unauthorized access. ๐
DISCUSSION ๐ฌ
In-band access is basically the stuff that goes through the normal network protocols, and it may or may not change the router's permanent operational state. That includes, but is not limited to, Telnet/RLOGIN console access and SNMP operations. ๐ฆ
This was a huge debate between the "works out of the box" crew and the "stay secure out of the box" crew ๐ญ. Automatic access to the router might add insecurities, but customers may care more about having a router they can reach over the network the second it's plugged in. At least one vendor ships routers with no external console access and relies on network access to finish configuring them. Iconic, honestly ๐ .
It's up to the vendor whether in-band access is on by default. It's also the vendor's job to make sure customers know about possible insecurities. No pressure ๐ซถ.
(2) A router MUST provide the ability to initiate an ICMP echo. The following options SHOULD be implemented:
- Choice of data patterns
- Choice of packet size
- Record route
and the following additional options MAY be implemented:
- Loose source route
- Strict source route
- Timestamps
(3) A router SHOULD provide the ability to initiate a traceroute. If traceroute is provided, then the 3rd party traceroute SHOULD be implemented. ๐บ๏ธ
Each of the above three facilities (if implemented) SHOULD have access restrictions placed on it to prevent its abuse by unauthorized persons. Locked down, bestie ๐.
10.4 Security Considerations ๐ก๏ธ๐
10.4.1 Auditing and Audit Trails ๐
Auditing and billing are the bane of every network operator's existence ๐ฉ, but they're also the two things that security people and the people paying the bills want most. Auditing is worth it when it helps you keep your network running and protects your resources from abuse, without costing more than those resources are worth. Real budget-conscious energy ๐ธ.
(1) Configuration Changes
Router SHOULD provide a method for auditing a configuration change of a router, even if it's something as simple as recording the operator's initials and time of change. ๐
DISCUSSION ๐ฌ
Configuration change logging (who changed what, and when) is so useful, especially when your traffic is suddenly taking a scenic route through Alaska on its way across town ๐. Being able to roll back to a previous configuration is also a total lifesaver โจ.
(2) Packet Accounting
Vendors should strongly consider providing a system for tracking traffic levels between pairs of hosts or networks. A mechanism for limiting the collection of this information to specific pairs of hosts or networks is also strongly encouraged. ๐
DISCUSSION ๐ฌ
A host traffic matrix like the one above can show the operator traffic trends that they just can't spot in other statistics ๐. It can also flag hosts or networks that are poking around the structure of the attached networks. For example, one outside host trying to send packets to every IP address in a connected network's address range. Sus behavior, no cap ๐ต๏ธโโ๏ธ.
(3) Security Auditing
Routers MUST provide a method for auditing security related failures or violations to include:
- Authorization Failures: bad passwords, invalid SNMP communities, invalid authorization tokens,
- Violations of Policy Controls: Prohibited Source Routes, Filtered Destinations, and
- Authorization Approvals: good passwords - Telnet in-band access, console access.
Routers MUST provide a method of limiting or disabling such auditing, but auditing SHOULD be on by default. Possible methods for auditing include listing violations to a console if present, logging or counting them internally, or logging them to a remote security server through the SNMP trap mechanism or the Unix logging mechanism as appropriate. A router MUST implement at least one of these reporting mechanisms, and it MAY implement more than one. Mix and match, babe ๐.
10.4.2 Configuration Control ๐
A vendor has a responsibility to use good configuration control practices when creating the software and firmware loads for their routers. In particular, if a vendor makes updates and loads available for retrieval over the Internet, the vendor should also provide a way for the customer to confirm the load is a valid one, perhaps by verifying a checksum over the load. โ
DISCUSSION ๐ฌ
Lots of vendors now push short-notice software updates over the Internet. That's a good trend and should be encouraged ๐, but it does create a point of vulnerability in the configuration control process. Plot twist, but a real one ๐ฌ.
If a vendor lets the customer change a router's configuration parameters remotely, for example through a Telnet session, the ability to do so SHOULD be configurable and SHOULD default to off. The router SHOULD require valid authentication before permitting remote reconfiguration. This authentication procedure SHOULD NOT transmit the authentication secret over the network. For example, if telnet is implemented, the vendor SHOULD IMPLEMENT Kerberos, S-Key, or a similar authentication procedure. ๐
DISCUSSION ๐ฌ
Letting your properly identified network operator twiddle with your routers is necessary. Letting anyone else do it is just foolhardy ๐.
A router MUST NOT have undocumented back door access and master passwords. A vendor MUST ensure that any such access added for debugging or product development purposes is deleted before the product is distributed to its customers. ๐ซ๐ช
DISCUSSION ๐ฌ
A vendor owes it to its customers to make sure they know about the vulnerabilities its code has by design, like in-band access. Trap doors, back doors, and master passwords, whether intentional or not, can turn a relatively secure router into a major headache on an operational network. The supposed operational benefits just don't outweigh the potential problems, bestie ๐ซ .
11. REFERENCES ๐
Implementors should be aware that Internet protocol standards are occasionally updated. These references are current as of this writing, but a cautious implementor will always check a recent version of the RFC index to make sure an RFC hasn't been updated or superseded by a newer RFC. Reference [INTRO:6] explains various ways to get a current RFC index. ๐
APPL:1. Croft, B., and J. Gilmore, "Bootstrap Protocol (BOOTP)", RFC 951, Stanford University, Sun Microsystems, September 1985.
APPL:2. Alexander, S., and R. Droms, "DHCP Options and BOOTP Vendor Extensions", RFC 1533, Lachman Technology, Inc., Bucknell University, October 1993.
APPL:3. Wimer, W., "Clarifications and Extensions for the Bootstrap Protocol", RFC 1542, Carnegie Mellon University, October 1993.
ARCH:1. DDN Protocol Handbook, NIC-50004, NIC-50005, NIC-50006 (three volumes), DDN Network Information Center, SRI International, Menlo Park, California, USA, December 1985.
ARCH:2. V. Cerf and R. Kahn, "A Protocol for Packet Network Intercommunication", IEEE Transactions on Communication, May 1974. Also included in [ARCH:1].
ARCH:3. J. Postel, C. Sunshine, and D. Cohen, "The ARPA Internet Protocol", Computer Networks, volume 5, number 4, July 1981. Also included in [ARCH:1].
ARCH:4. B. Leiner, J. Postel, R. Cole, and D. Mills, :The DARPA Internet Protocol Suite", Proceedings of INFOCOM '85, IEEE, Washington, DC, March 1985. Also in: IEEE Communications Magazine, March 1985. Also available from the Information Sciences Institute, University of Southern California as Technical Report ISI-RS-85-153.
ARCH:5. D. Comer, "Internetworking With TCP/IP Volume 1: Principles, Protocols, and Architecture", Prentice Hall, Englewood Cliffs, NJ, 1991.
ARCH:6. W. Stallings, "Handbook of Computer-Communications Standards Volume 3: The TCP/IP Protocol Suite", Macmillan, New York, NY, 1990.
ARCH:7. Postel, J., "Internet Official Protocol Standards", STD 1, RFC 1780, Internet Architecture Board, March 1995.
ARCH:8. Information processing systems - Open Systems Interconnection - Basic Reference Model, ISO 7489, International Standards Organization, 1984.
ARCH:9 R. Braden, J. Postel, Y. Rekhter, "Internet Architecture Extensions for Shared Media", 05/20/1994
FORWARD:1. IETF CIP Working Group (C. Topolcic, Editor), "Experimental Internet Stream Protocol", Version 2 (ST-II), RFC 1190, October 1990.
FORWARD:2. Mankin, A., and K. Ramakrishnan, Editors, "Gateway Congestion Control Survey", RFC 1254, MITRE, Digital Equipment Corporation, August 1991.
FORWARD:3. J. Nagle, "On Packet Switches with Infinite Storage", IEEE Transactions on Communications, volume COM-35, number 4, April 1987.
FORWARD:4. R. Jain, K. Ramakrishnan, and D. Chiu, "Congestion Avoidance in Computer Networks With a Connectionless Network Layer", Technical Report DEC-TR-506, Digital Equipment Corporation.
FORWARD:5. V. Jacobson, "Congestion Avoidance and Control", Proceedings of SIGCOMM '88, Association for Computing Machinery, August 1988.
FORWARD:6. W. Barns, "Precedence and Priority Access Implementation for Department of Defense Data Networks", Technical Report MTR-91W00029, The Mitre Corporation, McLean, Virginia, USA, July 1991.
FORWARD:7 Fang, Chen, Hutchins, "Simulation Results of TCP Performance over ATM with and without Flow Control", presentation to the ATM Forum, November 15, 1993.
FORWARD:8 V. Paxson, S. Floyd "Wide Area Traffic: the Failure of Poisson Modeling", short version in SIGCOMM '94.
FORWARD:9 Leland, Taqqu, Willinger and Wilson, "On the Self-Similar Nature of Ethernet Traffic", Proceedings of SIGCOMM '93, September, 1993.
FORWARD:10 S. Keshav "A Control Theoretic Approach to Flow Control", SIGCOMM 91, pages 3-16
FORWARD:11 K.K. Ramakrishnan and R. Jain, "A Binary Feedback Scheme for Congestion Avoidance in Computer Networks", ACM Transactions of Computer Systems, volume 8, number 2, 1980.
FORWARD:12 H. Kanakia, P. Mishara, and A. Reibman]. "An adaptive congestion control scheme for real-time packet video transport", In Proceedings of ACM SIGCOMM 1994, pages 20-31, San Francisco, California, September 1993.
FORWARD:13 A. Demers, S. Keshav, S. Shenker, "Analysis and Simulation of a Fair Queuing Algorithm", 93 pages 1-12
FORWARD:14 Clark, D., Shenker, S., and L. Zhang, "Supporting Real-Time Applications in an Integrated Services Packet Network: Architecture and Mechanism", 92 pages 14-26 โจ
INTERNET:1. Postel, J., "Internet Protocol", STD 5, RFC 791, USC/Information Sciences Institute, September 1981.
INTERNET:2. Mogul, J., and J. Postel, "Internet Standard Subnetting Procedure", STD 5, RFC 950, Stanford, USC/Information Sciences Institute, August 1985.
INTERNET:3. Mogul, J., "Broadcasting Internet Datagrams in the Presence of Subnets", STD 5, RFC 922, Stanford University, October 1984.
INTERNET:4. Deering, S., "Host Extensions for IP Multicasting", STD 5, RFC 1112, Stanford University, August 1989.
INTERNET:5. Kent, S., "U.S. Department of Defense Security Options for the Internet Protocol", RFC 1108, BBN Communications, November 1991.
INTERNET:6. Braden, R., Borman, D., and C. Partridge, "Computing the Internet Checksum", RFC 1071, USC/Information Sciences Institute, Cray Research, BBN Communications, September 1988.
INTERNET:7. Mallory T., and A. Kullberg, "Incremental Updating of the Internet Checksum", RFC 1141, BBN Communications, January 1990.
INTERNET:8. Postel, J., "Internet Control Message Protocol", STD 5, RFC 792, USC/Information Sciences Institute, September 1981.
INTERNET:9. A. Mankin, G. Hollingsworth, G. Reichlen, K. Thompson, R. Wilder, and R. Zahavi, "Evaluation of Internet Performance - FY89", Technical Report MTR-89W00216, MITRE Corporation, February, 1990.
INTERNET:10. G. Finn, A "Connectionless Congestion Control Algorithm", Computer Communications Review, volume 19, number 5, Association for Computing Machinery, October 1989.
INTERNET:11. Prue, W., and J. Postel, "The Source Quench Introduced Delay (SQuID)", RFC 1016, USC/Information Sciences Institute, August 1987.
INTERNET:12. McKenzie, A., "Some comments on SQuID", RFC 1018, BBN Labs, August 1987.
INTERNET:13. Deering, S., "ICMP Router Discovery Messages", RFC 1256, Xerox PARC, September 1991.
INTERNET:14. Mogul J., and S. Deering, "Path MTU Discovery", RFC 1191, DECWRL, Stanford University, November 1990.
INTERNET:15 Fuller, V., Li, T., Yu, J., and K. Varadhan, "Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy" RFC 1519, BARRNet, cisco, Merit, OARnet, September 1993.
INTERNET:16 St. Johns, M., "Draft Revised IP Security Option", RFC 1038, IETF, January 1988.
INTERNET:17 Prue, W., and J. Postel, "Queuing Algorithm to Provide Type-of-service For IP Links", RFC 1046, USC/Information Sciences Institute, February 1988.
INTERNET:18 Postel, J., "Address Mappings", RFC 796, USC/Information Sciences Institute, September 1981.
INTRO:1. Braden, R., and J. Postel, "Requirements for Internet Gateways", STD 4, RFC 1009, USC/Information Sciences Institute, June 1987.
INTRO:2. Internet Engineering Task Force (R. Braden, Editor), "Requirements for Internet Hosts - Communication Layers", STD 3, RFC 1122, USC/Information Sciences Institute, October 1989.
INTRO:3. Internet Engineering Task Force (R. Braden, Editor), "Requirements for Internet Hosts - Application and Support", STD 3, RFC 1123, USC/Information Sciences Institute, October 1989.
INTRO:4. Clark, D., "Modularity and Efficiency in Protocol Implementations", RFC 817, MIT Laboratory for Computer Science, July 1982.
INTRO:5. Clark, D., "The Structuring of Systems Using Upcalls", Proceedings of 10th ACM SOSP, December 1985.
INTRO:6. Jacobsen, O., and J. Postel, "Protocol Document Order Information", RFC 980, SRI, USC/Information Sciences Institute, March 1986.
INTRO:7. Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC 1700, USC/Information Sciences Institute, October 1994. This document is periodically updated and reissued with a new number. It is wise to verify occasionally that the version you have is still current. ๐ซถ
INTRO:8. DoD Trusted Computer System Evaluation Criteria, DoD publication 5200.28-STD, U.S. Department of Defense, December 1985.
INTRO:9 Malkin, G., and T. LaQuey Parker, Editors, "Internet Users' Glossary", FYI 18, RFC 1392, Xylogics, Inc., UTexas, January 1993.
LINK:1. Leffler, S., and M. Karels, "Trailer Encapsulations", RFC 893, University of California at Berkeley, April 1984.
LINK:2 Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, RFC 1661, Daydreamer July 1994.
LINK:3 McGregor, G., "The PPP Internet Protocol Control Protocol (IPCP)", RFC 1332, Merit May 1992.
LINK:4 Lloyd, B., and W. Simpson, "PPP Authentication Protocols", RFC 1334, L&A, Daydreamer, May 1992.
LINK:5 Simpson, W., "PPP Link Quality Monitoring", RFC 1333, Daydreamer, May 1992.
MGT:1. Rose, M., and K. McCloghrie, "Structure and Identification of Management Information of TCP/IP-based Internets", STD 16, RFC 1155, Performance Systems International, Hughes LAN Systems, May 1990.
MGT:2. McCloghrie, K., and M. Rose (Editors), "Management Information Base of TCP/IP-Based Internets: MIB-II", STD 16, RFC 1213, Hughes LAN Systems, Inc., Performance Systems International, March 1991.
MGT:3. Case, J., Fedor, M., Schoffstall, M., and J. Davin, "Simple Network Management Protocol", STD 15, RFC 1157, SNMP Research, Performance Systems International, MIT Laboratory for Computer Science, May 1990.
MGT:4. Rose, M., and K. McCloghrie (Editors), "Towards Concise MIB Definitions", STD 16, RFC 1212, Performance Systems International, Hughes LAN Systems, March 1991.
MGT:5. Steinberg, L., "Techniques for Managing Asynchronously Generated Alerts", RFC 1224, IBM Corporation, May 1991.
MGT:6. Kastenholz, F., "Definitions of Managed Objects for the Ethernet-like Interface Types", RFC 1398, FTP Software, Inc., January 1993.
MGT:7. McCloghrie, K., and R. Fox "IEEE 802.4 Token Bus MIB", RFC 1230, Hughes LAN Systems, Inc., Synoptics, Inc., May 1991.
MGT:8. McCloghrie, K., Fox R., and E. Decker, "IEEE 802.5 Token Ring MIB", RFC 1231, Hughes LAN Systems, Inc., Synoptics, Inc., cisco Systems, Inc., February 1993.
MGT:9. Case, J., and A. Rijsinghani, "FDDI Management Information Base", RFC 1512, The University of Tennesse and SNMP Research, Digital Equipment Corporation, September 1993.
MGT:10. Stewart, B., Editor "Definitions of Managed Objects for RS-232-like Hardware Devices", RFC 1317, Xyplex, Inc., April 1992.
MGT:11. Kastenholz, F., "Definitions of Managed Objects for the Link Control Protocol of the Point-to-Point Protocol", RFC 1471, FTP Software, Inc., June 1992.
MGT:12. Kastenholz, F., "The Definitions of Managed Objects for the Security Protocols of the Point-to-Point Protocol", RFC 1472, FTP Software, Inc., June 1992.
MGT:13. Kastenholz, F., "The Definitions of Managed Objects for the IP Network Control Protocol of the Point-to-Point Protocol", RFC 1473, FTP Software, Inc., June 1992.
MGT:14. Baker, F., and R. Coltun, "OSPF Version 2 Management Information Base", RFC 1253, ACC, Computer Science Center, August 1991.
MGT:15. Willis, S., and J. Burruss, "Definitions of Managed Objects for the Border Gateway Protocol (Version 3)", RFC 1269, Wellfleet Communications Inc., October 1991.
MGT:16. Baker, F., and J. Watt, "Definitions of Managed Objects for the DS1 and E1 Interface Types", RFC 1406, Advanced Computer Communications, Newbridge Networks Corporation, January 1993.
MGT:17. Cox, T., and K. Tesink, Editors "Definitions of Managed Objects for the DS3/E3 Interface Types", RFC 1407, Bell Communications Research, January 1993.
MGT:18. McCloghrie, K., "Extensions to the Generic-Interface MIB", RFC 1229, Hughes LAN Systems, August 1992.
MGT:19. Cox, T., and K. Tesink, "Definitions of Managed Objects for the SIP Interface Type", RFC 1304, Bell Communications Research, February 1992.
MGT:20 Baker, F., "IP Forwarding Table MIB", RFC 1354, ACC, July 1992.
MGT:21. Malkin, G., and F. Baker, "RIP Version 2 MIB Extension", RFC 1724, Xylogics, Inc., Cisco Systems, November 1994
MGT:22. Throop, D., "SNMP MIB Extension for the X.25 Packet Layer", RFC 1382, Data General Corporation, November 1992.
MGT:23. Throop, D., and F. Baker, "SNMP MIB Extension for X.25 LAPB", RFC 1381, Data General Corporation, ACC, November 1992.
MGT:24. Throop, D., and F. Baker, "SNMP MIB Extension for MultiProtocol Interconnect over X.25", RFC 1461, Data General Corporation, May 1993.
MGT:25. Rose, M., "SNMP over OSI", RFC 1418, Dover Beach Consulting, Inc., March 1993.
MGT:26. Minshall, G., and M. Ritter, "SNMP over AppleTalk", RFC 1419, Novell, Inc., Apple Computer, Inc., March 1993.
MGT:27. Bostock, S., "SNMP over IPX", RFC 1420, Novell, Inc., March 1993.
MGT:28. Schoffstall, M., Davin, C., Fedor, M., and J. Case, "SNMP over Ethernet", RFC 1089, Rensselaer Polytechnic Institute, MIT Laboratory for Computer Science, NYSERNet, Inc., University of Tennessee at Knoxville, February 1989.
MGT:29. Case, J., "FDDI Management Information Base", RFC 1285, SNMP Research, Incorporated, January 1992.
OPER:1. Nagle, J., "Congestion Control in IP/TCP Internetworks", RFC 896, FACC, January 1984.
OPER:2. Sollins, K., "TFTP Protocol (revision 2)", RFC 1350, MIT, July 1992.
ROUTE:1. Moy, J., "OSPF Version 2", RFC 1583, Proteon, March 1994.
ROUTE:2. Callon, R., "Use of OSI IS-IS for Routing in TCP/IP and Dual Environments", RFC 1195, DEC, December 1990.
ROUTE:3. Hedrick, C., "Routing Information Protocol", RFC 1058, Rutgers University, June 1988.
ROUTE:4. Lougheed, K., and Y. Rekhter, "A Border Gateway Protocol 3 (BGP-3)", RFC 1267, cisco, T.J. Watson Research Center, IBM Corp., October 1991.
ROUTE:5. Gross, P, and Y. Rekhter, "Application of the Border Gateway Protocol in the Internet", RFC 1772, T.J. Watson Research Center, IBM Corp., MCI, March 1995.
ROUTE:6. Mills, D., "Exterior Gateway Protocol Formal Specification", RFC 904, UDEL, April 1984.
ROUTE:7. Rosen, E., "Exterior Gateway Protocol (EGP)", RFC 827, BBN, October 1982.
ROUTE:8. Seamonson, L, and E. Rosen, "STUB" "Exterior Gateway Protocol", RFC 888, BBN, January 1984.
ROUTE:9. Waitzman, D., Partridge, C., and S. Deering, "Distance Vector Multicast Routing Protocol", RFC 1075, BBN, Stanford, November 1988. ๐
ROUTE:10. Deering, S., Multicast Routing in Internetworks and Extended LANs, Proceedings of '88, Association for Computing Machinery, August 1988. ๐ธ
ROUTE:11. Almquist, P., "Type of Service in the Internet Protocol Suite", RFC 1349, Consultant, July 1992. ๐
ROUTE:12. Rekhter, Y., "Experience with the BGP Protocol", RFC 1266, T.J. Watson Research Center, IBM Corp., October 1991. โจ
ROUTE:13. Rekhter, Y., "BGP Protocol Analysis", RFC 1265, T.J. Watson Research Center, IBM Corp., October 1991. ๐ฆ
TRANS:1. Postel, J., "User Datagram Protocol", STD 6, RFC 768, USC/Information Sciences Institute, August 1980. ๐
TRANS:2. Postel, J., "Transmission Control Protocol", STD 7, RFC 793, USC/Information Sciences Institute, September 1981. ๐
APPENDIX A. REQUIREMENTS FOR SOURCE-ROUTING HOSTS ๐ง
Okay so, there are some restrictions here, but a host MAY be able to act as an intermediate hop in a source route, which means forwarding a source-routed datagram on to the next specified hop. ๐ฆ
BUT, when a host is doing this router-like job, it MUST obey all the relevant rules for a router forwarding source-routed datagrams [INTRO:2]. Here's what that includes:
(A) TTL ๐ The TTL field MUST be decremented, and the datagram may be discarded, as specified for a router in [INTRO:2]. Literally the same rules, no cap. ๐ซถ
(B) ICMP Destination Unreachable ๐ญ A host MUST be able to generate Destination Unreachable messages with these codes:
4(Fragmentation Required but DF Set) when a source-routed datagram cannot be fragmented to fit into the target network.5(Source Route Failed) when a source-routed datagram cannot be forwarded, for example because of a routing problem, or because the next hop of a strict source route is not on a connected network. ๐
(C) IP Source Address ๐ A source-routed datagram being forwarded MAY (and normally will) have a source address that is not one of the IP addresses of the forwarding host. Yes, that's allowed, it's giving chaos but in a legal way. ๐
(D) Record Route Option ๐ A host that is forwarding a source-routed datagram containing a Record Route option MUST update that option, as long as it has room. ๐
(E) Timestamp Option โญ A host that is forwarding a source-routed datagram containing a Timestamp Option MUST add the current timestamp to that option, following the rules for this option. โฐ
Now, to define the rules that restrict host forwarding of source-routed datagrams, we use the term local source-routing if the next hop goes through the same physical interface the datagram arrived on. Otherwise it's non-local source-routing. โจ
A host is permitted to do local source-routing without any restriction. Main character energy, honestly. ๐
A host that supports non-local source-routing MUST have a configurable switch to disable forwarding, and this switch MUST default to disabled. Safety first, periodt. ๐
The host MUST satisfy all router requirements for configurable policy filters [INTRO:2] that restrict non-local forwarding. ๐ก๏ธ
If a host receives a datagram with an incomplete source route but doesn't forward it for some reason, the host SHOULD return an ICMP Destination Unreachable (code 5, Source Route Failed) message, unless the datagram was itself an ICMP error message. Ngl, that's a lot of rules, but they all make sense. ๐ซถ
APPENDIX B. GLOSSARY ๐
This Appendix defines the specific terms used in this memo, plus some general purpose terms that might be useful. For a more general set of definitions, check out [INTRO:9]. ๐ท
Autonomous System (AS) ๐
An Autonomous System (AS) is a connected segment of a network topology made up of a collection of subnetworks (with hosts attached) that are interconnected by a set of routes. The subnetworks and the routers are expected to be under the control of a single operations and maintenance (O&M) organization. Inside an AS, routers may use one or more interior routing protocols, and sometimes several sets of metrics. An AS is expected to present a coherent interior routing plan to other ASs, along with a consistent picture of the destinations reachable through the AS. An AS is identified by an Autonomous System number. ๐ฐ
Connected Network ๐
A network prefix that a router is interfaced to is often called a local network, or the subnetwork of that router. But those terms can be confusing, so this memo uses the term Connected Network instead. ๐
Connected (Sub)Network ๐งฉ
A Connected (Sub)Network is an IP subnetwork that a router is interfaced to, or a connected network if the connected network isn't subnetted. See also Connected Network. ๐
Datagram ๐ฆ
The unit transmitted between a pair of internet modules. Data, called datagrams, goes from sources to destinations. The Internet Protocol doesn't provide a reliable communication facility. There are no acknowledgments, end-to-end or hop-by-hop. There is no error, and no retransmissions. There is no flow control. See IP. ๐ญ
Default Route ๐ฃ๏ธ
A routing table entry used to direct any data addressed to a network prefix that isn't explicitly listed in the routing table. The catch-all of routing tables, iconic. โจ
Dense Mode ๐
In multicast forwarding, two paradigms are possible. In Dense Mode forwarding, a network multicast is forwarded as a data link layer multicast to all interfaces except the one it was received on, unless and until the router is told not to by a multicast routing neighbor. See Sparse Mode. ๐๐
EGP ๐ช
Exterior Gateway Protocol. A protocol that distributes routing information to the gateways (routers) that connect autonomous systems. See IGP. ๐
EGP-2 ๐
Exterior Gateway Protocol version 2. This is an EGP routing protocol developed to handle traffic between Autonomous Systems in the Internet. ๐
Forwarder ๐งญ
The logical entity within a router that is responsible for switching packets among the router's interfaces. The Forwarder also decides whether to queue a packet for local delivery, to queue a packet for transmission out another interface, or both. ๐ฆ
Forwarding ๐
Forwarding is the process a router goes through for each packet it receives. The packet may be consumed by the router, it may be output on one or more of the router's interfaces, or both. Forwarding includes deciding what to do with the packet, as well as queuing it up for (possible) output or internal consumption. ๐ฏ
Forwarding Information Base (FIB) ๐๏ธ
The table containing the information needed to forward IP Datagrams is called the Forwarding Information Base in this document. At minimum, it contains the interface identifier and next hop information for each reachable destination network prefix. ๐
Fragment ๐งฉ
An IP datagram that represents a portion of a higher layer's packet that was too large to be sent in its entirety over the output network. ๐ฐ
General Purpose Serial Interface ๐
A physical medium that can connect exactly two systems. It can therefore be configured as a point to point line, but it can also be configured to support link layer networking using protocols such as X.25 or Frame Relay. A link layer network connects another system to a switch, and a higher communication layer multiplexes virtual circuits on the connection. See Point to Point Line. ๐๏ธ
IGP ๐
Interior Gateway Protocol. A protocol that distributes routing information within an Autonomous System (AS). See EGP. ๐ก
Interface IP Address ๐ชช
The IP Address and network prefix length assigned to a specific interface of a router. ๐ท๏ธ
Internet Address ๐
An assigned number that identifies a host in an internet. It has two parts: an IP address and a prefix length. The prefix length indicates how many of the most specific bits of the address make up the network prefix. ๐
IP ๐
Internet Protocol. The network layer protocol for the Internet. It's a packet switching, datagram protocol defined in RFC 791. IP doesn't provide a reliable communications facility, which means there are no end-to-end or hop-by-hop acknowledgments. ๐โจ
IP Datagram ๐ฎ
An IP Datagram is the unit of end-to-end transmission in the Internet Protocol. An IP Datagram consists of an IP header followed by all of the higher-layer data (such as TCP, UDP, ICMP, and the like). In other words, an IP Datagram is an IP header followed by a message.
An IP Datagram is a complete IP end-to-end transmission unit. An IP Datagram is made up of one or more IP Fragments.
In this memo, the unqualified term Datagram should be understood to refer to an IP Datagram. ๐ฎ๐
IP Fragment ๐งฑ
An IP Fragment is a component of an IP Datagram. It consists of an IP header followed by all or part of the higher-layer data of the original IP Datagram.
One or more IP Fragments make up a single IP Datagram.
In this memo, the unqualified term Fragment should be understood to refer to an IP Fragment. ๐งฑ๐ซถ
IP Packet ๐
An IP Datagram or an IP Fragment.
In this memo, the unqualified term Packet should generally be understood to refer to an IP Packet. ๐
Logical [network] interface ๐ช
A logical [network] interface is a logical path, distinguished by a unique IP address, to a connected network. ๐ช
Martian Filtering ๐ฝ
A packet that contains an invalid source or destination address is considered martian and is discarded. Sus, but in a useful way. ๐ซ๐ฝ
MTU (Maximum Transmission Unit) ๐
The size of the largest packet that can be transmitted or received through a logical interface. This size includes the IP header, but does not include the size of any Link Layer headers or framing. ๐๐
Multicast ๐ฃ
A packet that is destined for multiple hosts. See broadcast. ๐ฃ
Multicast Address ๐ข
A special type of address that is recognizable by multiple hosts.
A Multicast Address is sometimes known as a Functional Address or a Group Address. ๐ฏ
Network Prefix ๐งฎ
The portion of an IP Address that signifies a set of systems. It is selected from the IP Address by logically ANDing a subnet mask with the address, or (equivalently) by setting the bits of the address that are not among the most significant <prefix-length> bits of the address to zero. ๐งฎ๐ธ
Originate ๐ฌ
Packets can be transmitted by a router for one of two reasons: 1) the packet was received and is being forwarded, or 2) the router itself created the packet for transmission (such as route advertisements). Packets that the router creates for transmission are said to originate at the router. ๐ฌ
Packet ๐ฌ
A packet is the unit of data passed across the interface between the Internet Layer and the Link Layer. It includes an IP header and data. A packet may be a complete IP datagram or a fragment of an IP datagram. ๐ฌ
Path ๐ค๏ธ
The sequence of routers and (sub-)networks that a packet traverses from a particular router to a particular destination host. Note that a path is uni-directional. It's not unusual to have different paths in the two directions between a given host pair, so don't assume they match! ๐๐
Physical Network ๐ธ A Physical Network is a network (or a piece of an internet) which is contiguous at the Link Layer. Its internal structure (if any) is transparent to the Internet Layer.
In this memo, several media components that are connected using devices such as bridges or repeaters are considered to be a single Physical Network, since those devices are transparent to the IP. ๐ง
Physical Network Interface ๐ฆ This is a physical interface to a Connected Network and has a (possibly unique) Link-Layer address. Multiple Physical Network Interfaces on a single router may share the same Link-Layer address, but the address must be unique for different routers on the same Physical Network.
Point to Point Line ๐ A physical medium capable of connecting exactly two systems. In this document, it is only used to refer to such a line when used to connect IP entities. See General Purpose Serial Interface.
router ๐ A special-purpose dedicated computer that connects several networks. Routers switch packets between these networks in a process known as forwarding. This process may be repeated several times on a single packet by multiple routers until the packet can be delivered to the final destination. It's switching from router to router to router... until the packet gets to its destination, literally a whole relay race ๐โโ๏ธ๐จ
RPF ๐ Reverse Path Forwarding, a method used to deduce the next hops for broadcast and multicast packets. โจ
Silently Discard ๐ This memo specifies several cases where a router is to Silently Discard a received packet (or datagram). This means that the router should discard the packet without further processing, and that the router will not send any ICMP error message (see Section [4.3.2]) as a result. However, for diagnosis of problems, the router should provide the capability of logging the error (see Section [1.3.3]), including the contents of the silently discarded packet, and should record the event in a statistics counter. Logging is the vibe, but no ICMP drama ๐คซ
Silently Ignore ๐ A router is said to Silently Ignore an error or condition if it takes no action other than possibly generating an error report in an error log or through some network management protocol, and discarding, or ignoring, the source of the error. In particular, the router does NOT generate an ICMP error message. Quiet quitting, but make it networking ๐ซถ
Sparse Mode ๐ In multicast forwarding, two paradigms are possible. In Sparse Mode forwarding, a network layer multicast datagram is forwarded as a data link layer multicast frame to routers and hosts that have asked for it. The initial forwarding state is the inverse of dense-mode, in that it assumes no part of the network wants the data. See Dense Mode. ๐ฆ
Specific-destination address ๐ This is defined to be the destination address in the IP header, unless the header contains an IP broadcast or IP multicast address. In that case, the specific-destination is an IP address assigned to the physical interface on which the packet arrived. โจ
subnet ๐ธ A portion of a network, which may be a physically independent network, which shares a network address with other portions of the network and is distinguished by a subnet number. A subnet is to a network what a network is to an internet. Nesting dolls, but make it IP ๐ช
subnet number ๐ A part of the internet address that designates a subnet. It is ignored for the purposes of internet routing, but is used for intranet routing. ๐ง
TOS ๐ซถ Type Of Service. A field in the IP header that represents the degree of reliability expected from the network layer by the transport layer or application. ๐
TTL โญ Time To Live. A field in the IP header that represents how long a packet is considered valid. It is a combination hop count and timer value. Two clocks in one field, iconic ๐ฐ๏ธ๐
APPENDIX C. FUTURE DIRECTIONS ๐ฎ
This appendix lists work that future revisions of this document may wish to address.
In the preparation of Router Requirements, we stumbled across several other architectural issues. Each of these is dealt with somewhat in the document, but still ought to be classified as an open issue in the IP architecture. ๐งฉ
Most of the he topics presented here generally indicate areas where the technology is still relatively new, and it is not appropriate to develop specific requirements since the community is still gaining operational experience. ๐ฑ
Other topics represent areas of ongoing research and indicate areas that the prudent developer would closely monitor. ๐
- (1) SNMP Version 2
- (2) Additional SNMP MIBs
- (7) More detailed requirements for leaking routes between routing protocols
- (8) Router system security
- (9) Routing protocol security
- (10) Internetwork Protocol layer security. There has been extensive work refining the security of IP since the original work writing this document. This security work should be included in here. ๐
- (12) Load Splitting
- (13) Sending fragments along different paths
- (15) Multiple logical (sub)nets on the same wire. Router Requirements does not require support for this. We made some attempt to identify pieces of the architecture (e.g., forwarding of directed broadcasts and issuing of Redirects) where the wording of the rules has to be done carefully to make the right thing happen, and tried to clearly distinguish logical interfaces from physical interfaces. However, we did not study this issue in detail, and we are not at all confident that all the rules in the document are correct in the presence of multiple logical (sub)nets on the same wire. ๐ญ
- (15) Congestion control and resource management. On the advice of the IETF's experts (Mankin and Ramakrishnan), we deprecated (SHOULD NOT) Source Quench and said little else concrete (Section 5.3.6). ๐ซ
- (16) Developing a Link-Layer requirements document that would be common for both routers and hosts.
- (17) Developing a common PPP LQM algorithm.
- (18) Investigate of other information (above and beyond section [3.2]) that passes between the layers, such as physical network MTU, mappings of IP precedence to Link Layer priority values, etc.
- (19) Should the Link Layer notify IP if address resolution failed (just like it notifies IP when there is a Link Layer priority value problem)?
- (20) Should all routers be required to implement a DNS resolver?
- (21) Should a human user be able to use a host name anywhere you can use an IP address when configuring the router? Even in ping and traceroute? ๐ค
- (22) Almquist's draft ruminations on the next hop and ruminations on route leaking need to be reviewed, brought up to date, and published. ๐
- (23) Investigation is needed to determine if a redirect message for precedence is needed or not. If not, are the type-of-service redirects acceptable?
- (24) RIPv2 and RIP+CIDR and variable length network prefixes.
- (25) BGP-4 CIDR is going to be important, and everyone is betting on BGP-4. We can't avoid mentioning it. Probably need to describe the differences between BGP-3 and BGP-4, and explore upgrade issues... ๐
- (26) Loose Source Route Mobile IP and some multicasting may require this. Perhaps it should be elevated to a SHOULD (per Fred Baker's Suggestion). ๐
APPENDIX D. Multicast Routing Protocols ๐ก
Multicasting is a relatively new technology within the Internet Protocol family. It is not widely deployed or commonly in use yet. Its importance, however, is expected to grow over the coming years. ๐
This Appendix describes some of the technologies being investigated for routing multicasts through the Internet. ๐
A diligent implementor will keep abreast of developments in this area to properly develop multicast facilities. ๐ง
This Appendix does not specify any standards or requirements. ๐ซถ
D.1 Introduction โจ
Multicast routing protocols enable the forwarding of IP multicast datagrams throughout a TCP/IP internet. Generally these algorithms forward the datagram based on its source and destination addresses. Additionally, the datagram may need to be forwarded to several multicast group members, at times requiring the datagram to be replicated and sent out multiple interfaces. ๐
The state of multicast routing protocols is less developed than the protocols available for the forwarding of IP unicasts. Three experimental multicast routing protocols have been documented for TCP/IP. Each uses the IGMP protocol (discussed in Section [4.4]) to monitor multicast group membership. ๐ง
D.2 Distance Vector Multicast Routing Protocol - DVMRP ๐ธ
DVMRP, documented in [ROUTE:9], is based on Distance Vector or Bellman-Ford technology. It routes multicast datagrams only, and does so within a single Autonomous System. DVMRP is an implementation of the Truncated Reverse Path Broadcasting algorithm described in [ROUTE:10]. In addition, it specifies the tunneling of IP multicasts through non-multicast-routing-capable IP domains. ๐ฆ
D.3 Multicast Extensions to OSPF - MOSPF ๐
MOSPF, currently under development, is a backward-compatible addition to OSPF that allows the forwarding of both IP multicasts and unicasts within an Autonomous System. MOSPF routers can be mixed with OSPF routers within a routing domain, and they will interoperate in the forwarding of unicasts. OSPF is a link-state or SPF-based protocol. ๐
By adding link state advertisements that pinpoint group membership, MOSPF routers can calculate the path of a multicast datagram as a tree rooted at the datagram source. Those branches that do not contain group members can then be discarded, eliminating unnecessary datagram forwarding hops. ๐ณ
D.4 Protocol Independent Multicast - PIM ๐
PIM, currently under development, is a multicast routing protocol that runs over an existing unicast infrastructure. PIM provides for both dense and sparse group membership. It is different from other protocols, since it uses an explicit join model for sparse groups. Joining occurs on a shared tree and can switch to a per-source tree. Where bandwidth is plentiful and group membership is dense, overhead can be reduced by flooding data out all links and later pruning exception cases where there are no group members. ๐
APPENDIX E Additional Next-Hop Selection Algorithms ๐ง
Section [5.2.4.3] specifies an algorithm that routers ought to use when selecting a next-hop for a packet. ๐
This appendix provides historical perspective for the next-hop selection problem. It also presents several additional pruning rules and next-hop selection algorithms that might be found in the Internet. ๐
This appendix presents material drawn from an earlier, unpublished, work by Philip Almquist; Ruminations on the Next Hop. โ๏ธ
This Appendix does not specify any standards or requirements. ๐
E.1. Some Historical Perspective โจ
Okay bestie, let's do a quick history lesson ๐ It's giving origin story. We start with what people call the "classic model" of how a router makes routing decisions. This model predates IP ๐ฐ๏ธ. In it, a router speaks one single routing protocol, like RIP. That protocol completely decides what goes in the router's Forwarding Information Base (FIB) ๐ . The lookup is super simple: the router checks the FIB for a route whose destination attribute exactly matches the network prefix part of the packet's destination address. Found one? Use it. Found none? The destination is unreachable ๐. Because the routing protocol keeps at most one route to each destination, the "what if there are several matching routes?" problem literally never comes up ๐
Over the years, the classic model got augmented in small ways. Once default routes, subnets, and host routes were deployed, it became possible to have more than one routing table entry that somehow matched the destination. This was easily sorted out by agreeing there's a hierarchy of routes: host routes are preferred over subnet routes, subnet routes over net routes, and net routes over default routes ๐ธ
Then came technologies supporting variable length subnet masks (variable length network prefixes). The general approach stayed the same, but the description got a little more complicated. Network prefixes were introduced as a conscious simplification and regularization of the architecture ๐ Now we say that each route to a network prefix has a prefix length associated with it. This prefix length is the number of bits in the prefix, and it may also be written using the classical subnet mask. A route can't be used to route a packet unless each significant bit in the route's network prefix matches the corresponding bit in the packet's destination address. Routes with more bits set in their masks are preferred over routes with fewer bits set in their masks. This is just a generalization of the hierarchy we already talked about, and for the rest of this memo it will be called choosing a route by preferring longest match ๐ฆ
Another way the classic model got augmented was by relaxing, just a little, the idea that a routing protocol has complete control over the routing table. First, static routes were introduced. For the first time, you could have two routes to the same destination at once, one dynamic and one static ๐ญ When that happened, a router needed a policy (sometimes configurable, sometimes picked by whoever wrote the router's software) to decide whether the static or the dynamic route wins. BUT this policy was only used as a tie-breaker when longest match didn't uniquely pick a route. So, for example, a static default route would never beat a dynamic net route, even if the policy preferred static routes over dynamic ones. Main character energy for longest match, no cap ๐
The classic model had to be augmented even further once inter-domain routing protocols were invented. Traditional routing protocols became known as "interior gateway protocols" (IGPs). At each Internet site there was a strange new beast called an "exterior gateway": a router that spoke EGP to several "BBN Core Gateways" (the routers that formed the Internet backbone back then) at the same time as it spoke its IGP to the other routers at its site ๐ง Both protocols wanted to decide the contents of the router's routing table. In theory, a router could end up with three routes (EGP, IGP, and static) to the same destination. Because of the Internet topology at the time, people agreed pretty quickly (with little debate) that routers were best served by preferring IGP routes over EGP routes. Still, longest match stayed untouchable: a default route learned from the IGP would never beat a net route learned from EGP ๐
The Internet's topology, and therefore its routing, has changed a LOT since then. Still, this slightly augmented version of the classic model has survived intact to this day, except that BGP has replaced EGP ๐ Conceptually (and often in implementation too), each router has a routing table and one or more routing protocol processes. Each of these processes can add any entry it wants, and can delete or modify any entry that it created itself. When routing a packet, the router picks the best route using longest match, plus a policy mechanism to break ties. The augmented classic model has served us well, but it has a few shortcomings, periodt ๐
- It ignores (although it could be augmented to consider) path characteristics such as quality of service and MTU.
- It doesn't support routing protocols (such as OSPF and Integrated IS-IS) that require route lookup algorithms different from pure longest match.
- There has never been a firm consensus on what the tie-breaking mechanism ought to be. Tie-breaking mechanisms have often been found to be difficult, if not impossible, to configure so that the router always picks what the network manager considers the "correct" route ๐
E.2. Additional Pruning Rules ๐ช
Section [5.2.4.3] defined several pruning rules for selecting routes from the FIB. There are other rules that could also be used โจ
- OSPF Route Class
Routing protocols that have areas, or that distinguish between internal and external routes, divide their routes into classes based on the type of information used to calculate each route. A route is always chosen from the most preferred class unless none is available, in which case one is chosen from the second most preferred class, and so on. In OSPF, the classes (in order from most preferred to least preferred) are intra-area, inter-area, type 1 external (external routes with internal metrics), and type 2 external. As an extra wrinkle, a router is configured to know which addresses ought to be reachable using intra-area routes, and it will not use inter-area or external routes to reach those destinations, even when no intra-area route is available ๐ซถ
More precisely, we assume each route has a class attribute, called route.class, which is assigned by the routing protocol. The set of candidate routes is examined to see if it contains any for which route.class = intra-area. If so, all routes except those for which route.class = intra-area are discarded. Otherwise, the router checks whether the packet's destination falls within the address ranges configured for the local area. If so, the entire set of candidate routes is deleted. Otherwise, the set of candidate routes is examined to see if it contains any for which route.class = inter-area. If so, all routes except those for which route.class = inter-area are discarded. Otherwise, the set of candidate routes is examined to see if it contains any for which route.class = type 1 external. If so, all routes except those for which route.class = type 1 external are discarded.
- IS-IS Route Class
IS-IS route classes work identically to OSPF's. However, the set of classes defined by Integrated IS-IS is different, so there isn't a one-to-one mapping between IS-IS route classes and OSPF route classes. The Integrated IS-IS route classes are (in order from most preferred to least preferred) intra-area, inter-area, and external ๐ท
The Integrated IS-IS internal class is equivalent to the OSPF internal class. Likewise, the Integrated IS-IS external class is equivalent to OSPF's type 2 external class. However, Integrated IS-IS does not distinguish between inter-area routes and external routes with internal metrics. Both are considered inter-area routes. So OSPF prefers true inter-area routes over external routes with internal metrics, whereas Integrated IS-IS gives the two types of routes equal preference ๐คทโโ๏ธ
- IDPR Policy
This is a specific case of Policy. The IETF's Inter-domain Policy Routing Working Group is devising a routing protocol called Inter-Domain Policy Routing (IDPR) to support true policy-based routing in the Internet. Packets with certain combinations of header attributes (such as specific combinations of source and destination addresses, or special IDPR source route options) are required to use routes provided by the IDPR protocol. So, unlike other Policy pruning rules, IDPR Policy would have to be applied before any other pruning rules except Basic Match ๐ฅ
Specifically, IDPR Policy examines the packet being forwarded to find out whether its attributes require it to be forwarded using policy-based routes. If so, IDPR Policy deletes all routes not provided by the IDPR protocol ๐
E.3 Some Route Lookup Algorithms ๐
This section examines several route lookup algorithms that are in use or have been proposed. Each one is described by giving the sequence of pruning rules it uses. The strengths and weaknesses of each algorithm are presented
E.3.1 The Revised Classic Algorithm ๐
The Revised Classic Algorithm is the form of the traditional algorithm that was discussed in Section [E.1]. The steps of this algorithm are:
- Basic match
- Longest match
- Best metric
- Policy
Some implementations omit the Policy step, since it's only needed when routes may have metrics that aren't comparable (because they were learned from different routing domains) ๐
The advantages of this algorithm are:
- It is widely implemented.
- Except for the Policy step (which an implementor can choose to make arbitrarily complex), the algorithm is simple both to understand and to implement. ๐ฅฐ
Its disadvantages are:
- It does not handle IS-IS or OSPF route classes, and therefore cannot be used for Integrated IS-IS or OSPF.
- It does not handle TOS or other path attributes.
- The policy mechanisms are not standardized in any way, and are therefore often implementation-specific. This causes extra work for implementors (who must invent appropriate policy mechanisms) and for users (who must learn how to use the mechanisms). This lack of a standardized mechanism also makes it difficult to build consistent configurations for routers from different vendors. This presents a significant practical deterrent to multi-vendor interoperability ๐ค
- The proprietary policy mechanisms currently provided by vendors are often inadequate in complex parts of the Internet.
- The algorithm has not been written down in any generally available document or standard. It is, in effect, a part of the Internet Folklore ๐งโโ๏ธ
E.3.2 The Variant Router Requirements Algorithm โจ
okay so some folks in the Router Requirements Working Group came up with a slightly tweaked version of the algorithm in Section [5.2.4.3] ๐ In this version, matching the type of service that was requested is considered more important, not less important, than matching as much of the destination address as possible. ๐ So this one would pick a default route with the right type of service over a network route with the default type of service. The regular algorithm in [5.2.4.3] makes the opposite call ๐
The steps are:
- Basic match
- Weak TOS
- Longest match
- Best metric
- Policy
The people backing this one and the people backing the regular Router Requirements Algorithm have both shown cases where their own algorithm gives simpler, more intuitive routing. ๐ฆ This variant has the same advantages and disadvantages as the algorithm in [5.2.4.3], with one exception. Pruning on Weak TOS before pruning on Longest Match makes this algorithm less compatible with OSPF and Integrated IS-IS than the standard Router Requirements Algorithm is. ๐
E.3.3 The OSPF Algorithm ๐ธ
OSPF uses an algorithm that is basically the same as the Router Requirements Algorithm, with one big difference: OSPF takes OSPF route classes into account. ๐
The steps are:
- Basic match
- OSPF route class
- Longest match
- Weak TOS
- Best metric
- Policy
Type of service support isn't always there. If it isn't, then the fourth step gets skipped, obviously. ๐
This algorithm has some perks over the Revised Classic Algorithm:
- It supports type of service routing.
- Its rules are written down, rather than just living in Internet folklore. ๐
- It (obviously) works with OSPF. ๐
But it also keeps some of the downsides of the Revised Classic Algorithm:
- Path properties other than type of service (for example, MTU) get ignored.
- Just like in the Revised Classic Algorithm, the details (or even whether it exists at all) of the Policy step are left up to the implementor.
The OSPF Algorithm has one more downside that the Revised Classic Algorithm doesn't have. OSPF internal routes (intra-area or inter-area) are always treated as better than routes learned from other routing protocols, even when the OSPF route matches fewer bits of the destination address. That's a policy decision that's a bad fit for some networks. ๐ฌ
Last thing: the OSPF Algorithm's TOS support has a flaw. Routing protocols that support TOS are implicitly preferred when forwarding packets that have a non-zero TOS value. That might not be the right move in some cases. ๐ซ
E.3.4 The Integrated IS-IS Algorithm ๐ง
Integrated IS-IS uses an algorithm that's similar to the OSPF Algorithm, but not quite identical. It uses a different set of route classes, and its handling of type of service is a little different. ๐ The steps are:
- Basic Match
- IS-IS Route Classes
- Longest Match
- Weak TOS
- Best Metric
- Policy
Even though Integrated IS-IS uses Weak TOS, the protocol can only carry routes for a small, specific subset of the possible values in the TOS field of the IP header. Packets with other TOS values get routed using the default TOS. ๐ค
Type of service support is optional. If it's turned off, the fourth step gets skipped. Like in OSPF, the specification doesn't include the Policy step. ๐ซถ
This algorithm has some perks over the Revised Classic Algorithm:
- It supports type of service routing.
- Its rules are written down, rather than just living in Internet folklore. ๐
- It (obviously) works with Integrated IS-IS. โจ
It also keeps some of the downsides of the Revised Classic Algorithm:
- Path properties other than type of service (for example, MTU) get ignored.
- Just like in the Revised Classic Algorithm, the details (or even whether it exists at all) of the Policy step are left up to the implementor.
- It doesn't work with OSPF, because IS-IS route classes and OSPF route classes are different. Also, since IS-IS only supports a subset of the possible TOS values, some obvious implementations of the Integrated IS-IS algorithm wouldn't support OSPF's interpretation of TOS either. ๐ฅฒ
The Integrated IS-IS Algorithm has one more downside that the Revised Classic Algorithm doesn't have. IS-IS internal routes (intra-area or inter-area) are always treated as better than routes learned from other routing protocols. That happens even when the IS-IS route matches fewer bits of the destination address and doesn't provide the requested type of service. It's a policy decision that may not be appropriate in every case. ๐
Finally, the Integrated IS-IS Algorithm's TOS support has the same flaw we already saw with the OSPF Algorithm. ๐
Security Considerations ๐
Okay, bestie, the focus of this document is interoperability, not security. Still, lots of sections here have some effect on network security. ๐ซถ
Security means different things to different people. From a router's point of view, security is anything that keeps its own networks running and also helps keep the Internet as a whole healthy. ๐ For this document, the security services we care about are denial of service, integrity, and authentication as it applies to the first two. Privacy matters as a security service, but it's only a side concern for a router, at least as of the date of this document. ๐ฆ
A bunch of places in this document have sections called ... Security Considerations. Those sections go over specific considerations for the general topic being discussed. ๐
This document almost never says "do this and your router or network will be secure." ๐ โโ๏ธ It's way more like "this is a good idea, and if you do it, it may improve the security of the Internet and your local system in general." ๐
Unfortunately, this is the state of the art AT THIS TIME. Few, if any, of the network protocols a router deals with have solid built-in security features. Industry and protocol designers have been struggling with this and still are. ๐ญ There's progress, but it's only small baby steps, like the peer-to-peer authentication available in the BGP and OSPF routing protocols. ๐ฃ
This document also points to current research into developing and improving network security. As of this writing (December 1993), the areas of research, development, and engineering in progress are IP Security, SNMP Security, and common authentication technologies. ๐ฌ
That said, vendors and users can still do things to make their routers more secure. โจ Vendors should get a copy of Trusted Computer System Interpretation [INTRO:8]. Even if a vendor decides not to submit their device for formal verification under those guidelines, the publication is excellent guidance on general security design and practices for computing devices. ๐
APPENDIX F: HISTORICAL ROUTING PROTOCOLS ๐ฆ
Some routing protocols are still common on the Internet, but the authors of this document can't in good conscience recommend using them. ๐ฅบ It's not because they don't work correctly. It's because the characteristics of the Internet they were designed around (simple routing, no policy, a single "core router" network under common administration, limited complexity, or limited network diameter) aren't features of today's Internet. The parts of the Internet that still use them are mostly small "fringe" domains with limited complexity. ๐ฟ
Still, in good faith, the collected wisdom about implementing them is recorded in this section. ๐
F.1 EXTERIOR GATEWAY PROTOCOL - EGP ๐
F.1.1 Introduction ๐
The Exterior Gateway Protocol (EGP) specifies an EGP that's used to exchange reachability information between routers in the same or different autonomous systems. EGP isn't considered a routing protocol, because there's no standard interpretation (that is, no metric) for the distance fields in the EGP update message. So distances are only comparable among routers in the same AS. ๐คทโโ๏ธ It is, however, designed to provide high-quality reachability information, both about neighbor routers and about routes to non-neighbor routers. โจ
EGP is defined by [ROUTE:6]. An implementor almost certainly wants to read [ROUTE:7] and [ROUTE:8] too, because they have useful explanations and background material. ๐
DISCUSSION ๐ง The present EGP specification has serious limitations. The most important one is a restriction that limits routers to advertising only those networks that are reachable from within the router's autonomous system. This restriction against propagating third party EGP information exists to prevent long-lived routing loops, and it effectively limits EGP to a two-level hierarchy. ๐ค RFC-975 is not a part of the EGP specification, and should be ignored. ๐ซ
F.1.2 Protocol Walk-through โจ
okay so bestie, time for the EGP rules ๐
Indirect Neighbors: RFC-888, page 26
An implementation of EGP MUST include indirect neighbor support. ๐ซถ
Polling Intervals: RFC-904, page 10
The interval between Hello command retransmissions and the interval between Poll retransmissions SHOULD be configurable, but there MUST be a minimum value defined. ๐
The interval at which an implementation will respond to Hello commands and Poll commands SHOULD be configurable, but there MUST be a minimum value defined. ๐ธ
Network Reachability: RFC-904, page 15
An implementation MUST default to not providing the external list of routers in other autonomous systems. Only the internal list of routers, together with the nets that are reachable through those routers, should be included in an Update Response/Indication packet. ๐ฆ An implementation MAY elect to provide a configuration option enabling the external list to be provided. An implementation MUST NOT include in the external list routers that were learned through the external list provided by a router in another autonomous system. An implementation MUST NOT send a network back to the autonomous system from which it is learned. In other words, it MUST do split-horizon on an autonomous system level. ๐ซ
If more than 255 internal or 255 external routers need to be specified in a Network Reachability update, the networks reachable from routers that can not be listed MUST be merged into the list for one of the listed routers. Which of the listed routers is chosen for this purpose SHOULD be user configurable, but SHOULD default to the source address of the EGP update being generated. ๐ง
An EGP update contains a series of blocks of network numbers. Each block contains a list of network numbers reachable at a particular distance through a particular router. If more than 255 networks are reachable at a particular distance through a particular router, they are split into multiple blocks (all of which have the same distance). Similarly, if more than 255 blocks are required to list the networks reachable through a particular router, the router's address is listed as many times as necessary to include all the blocks in the update. ๐ฆ
Unsolicited Updates: RFC-904, page 16
If a network is shared with the peer, an implementation MUST send an unsolicited update upon entry to the Up state if the source network is the shared network. ๐
Neighbor Reachability: RFC-904, page 6, 13-15
The table on page 6 that describes the values of j and k (the neighbor up and down thresholds) is incorrect. It is reproduced correctly here:
Name Active Passive Description
-----------------------------------------------
j 3 1 neighbor-up threshold
k 1 0 neighbor-down threshold
The value for k in passive mode is also specified incorrectly in RFC-904, page 14. The values in parentheses should read:
(j = 1, k = 0, and T3/T1 = 4)
As an optimization, an implementation can refrain from sending a Hello command when a Poll is due. If an implementation does so, it SHOULD provide a user configurable option to disable this optimization. ๐
Abort timer: RFC-904, pages 6, 12, 13
An EGP implementation MUST include support for the abort timer (as documented in section 4.1.4 of RFC-904). An implementation SHOULD use the abort timer in the Idle state to automatically issue a Start event to restart the protocol machine. Recommended values are P4 for a critical error (Administratively prohibited, Protocol Violation and Parameter Problem) and P5 for all others. The abort timer SHOULD NOT be started when a Stop event was manually initiated (such as through a network management protocol). โฑ๏ธ
Cease command received in Idle state: RFC-904, page 13
When the EGP state machine is in the Idle state, it MUST reply to Cease commands with a Cease-ack response. ๐
Hello Polling Mode: RFC-904, page 11
An EGP implementation MUST include support for both active and passive polling modes. ๐
Neighbor Acquisition Messages: RFC-904, page 18
As noted, the Hello and Poll Intervals should only be present in Request and Confirm messages. Therefore, the length of an EGP Neighbor Acquisition Message is 14 bytes for a Request or Confirm message and 10 bytes for a Refuse, Cease or Cease-ack message. Implementations MUST NOT send 14 bytes for Refuse, Cease or Cease-ack messages, but MUST allow for implementations that send 14 bytes for these messages. ๐
Sequence Numbers: RFC-904, page 10
Response or indication packets received with a sequence number not equal to S MUST be discarded. The send sequence number S MUST be incremented just before the time a Poll command is sent and at no other times. ๐ข
F.2 ROUTING INFORMATION PROTOCOL - RIP ๐
F.2.1 Introduction
RIP is specified in [ROUTE:3]. Although RIP is still quite important in the Internet, it is being replaced in sophisticated applications by more modern IGPs such as the ones described above. A router implementing RIP SHOULD implement RIP Version 2 [ROUTE:?], as it supports CIDR routes. If occasional access networking is in use, a router implementing RIP SHOULD implement Demand RIP [ROUTE:?]. ๐
Another common use for RIP is as a router discovery protocol. Section [4.3.3.10] briefly touches upon this subject. ๐
F.2.2 Protocol Walk-Through
Dealing with changes in topology: [ROUTE:3], page 11
An implementation of RIP MUST provide a means for timing out routes. Since messages are occasionally lost, implementations MUST NOT invalidate a route based on a single missed update. ๐ง
Implementations MUST by default wait six times the update interval before invalidating a route. A router MAY have configuration options to alter this value. โณ
DISCUSSION
It is important to routing stability that all routers in a RIP autonomous system use a similar timeout value for invalidating routes, so it is important that an implementation default to the timeout value specified in the RIP specification. ๐ญ
However, that timeout value is too conservative in environments where packet loss is reasonably rare. In such an environment, a network manager may wish to be able to decrease the timeout period to promote faster recovery from failures. ๐
IMPLEMENTATION
There is a very simple mechanism that a router may use to meet the requirement to invalidate routes promptly after they time out. Whenever the router scans the routing table to see if any routes have timed out, it also notes the age of the least recently updated route that has not yet timed out. Subtracting this age from the timeout period gives the amount of time until the router again needs to scan the table for timed-out routes. ๐งฎ
Split Horizon: [ROUTE:3], page 14-15
Okay bestie, split horizon is RIP's way of dodging problems that happen when a router sends a route right back to the router it learned that route from ๐. An implementation of RIP MUST implement split horizon, no exceptions ๐ .
Then there's the glow-up version, split horizon with poisoned reverse โจ. It still includes learned routes in updates to the router they came from, but it sets their metric to infinity. An implementation of RIP SHOULD implement Split horizon with poisoned reverse ๐ซถ. Since that extra overhead may be a lot, implementations MAY include an option to select whether poisoned reverse is in effect ๐. And an implementation SHOULD limit the time in which it sends reverse routes at an infinite metric โณ.
IMPLEMENTATION
Each of these algorithms can cap how long poisoned reverse sticks around for a route ๐ฆ. The first one is more complex, but it's much more precise about only using poisoned reverse when it's actually needed ๐ง .
The goal of both is the same: poison reverse should happen for any destination whose route changed in the last Route Lifetime (usually 180 seconds), unless the router can be sure the old route used the same output interface ๐ธ. The Route Lifetime matters because it's how long RIP keeps an old route around before calling it stale ๐.
Here are the time intervals and derived variables:
TuThe Update Timer; the number of seconds between RIP updates. This typically defaults to 30 seconds.RlThe Route Lifetime, in seconds. This is the amount of time that a route is presumed to be good, without requiring an update. This typically defaults to 180 seconds.UlThe Update Loss; the number of consecutive updates that have to be lost or fail to mention a route before RIP deletes the route.Ulis calculated to be(Rl/Tu)+1. The+1accounts for the fact that the first time theifcounteris decremented will be less thanTuseconds after it is initialized. Typically,Ulwill be 7:(180/30)+1.InThe value to setifcounterto when a destination is newly learned. This value isUl-4, where the 4 is RIP's garbage collection timer/30.
The first algorithm goes like this:
- Every destination gets a counter called the
ifcounter. Poison reverse is done for any route whose destination'sifcounteris greater than zero ๐ข. - After a regular update is sent (not a triggered one, and not one sent in response to a request), all the non-zero
ifcounters get decremented by one โฌ๏ธ. - When a route to a destination is created, its
ifcountergets set like this:- If the new route is superseding a valid route, and the old route used a different (logical) output interface, then the
ifcounteris set toUl. - If the new route is superseding a stale route, and the old route used a different (logical) output interface, then the
ifcounteris set toMAX(0, Ul - INT(seconds that the route has been stale/Ut). - If there was no previous route to the destination, the
ifcounteris set toIn. - Otherwise, the
ifcounteris set to zero.
- If the new route is superseding a valid route, and the old route used a different (logical) output interface, then the
- RIP also keeps a timer called the
resettimer. Poison reverse is done on all routes whenever theresettimerhas not expired, no matter what theifcountervalues are โฐ. - When RIP is started, restarted, reset, or otherwise has its routing table cleared, it sets the
resettimerto go off inRlseconds ๐.
The second algorithm is the same as the first, except that:
- The rules which set the
ifcounterto non-zero values are changed to always set it toRl/Tu, and - The
resettimeris eliminated ๐๏ธ.
Triggered updates: [ROUTE:3], page 15-16; page 29
Triggered updates (also called flash updates) are how a router immediately tells its neighbors when it adds or deletes routes, or changes their metrics โก. A router MUST send a triggered update when routes are deleted or their metrics are increased ๐จ. A router MAY send a triggered update when routes are added or their metrics decreased ๐.
Triggered updates can cause a lot of routing overhead, so implementations MUST use the following mechanism to limit how often they go out ๐:
- When a router sends a triggered update, it sets a timer to a random time between one and five seconds in the future. The router must not generate additional triggered updates before this timer expires โฒ๏ธ.
- If the router would generate a triggered update during this interval, it sets a flag saying a triggered update is desired. The router also logs the desired triggered update ๐.
- When the triggered update timer expires, the router checks the flag. If it's set, the router sends a single triggered update that includes all the logged changes. Then it clears the flag and, since it just sent a triggered update, restarts this algorithm ๐.
- The flag also gets cleared whenever a regular update is sent ๐งน.
Triggered updates SHOULD include all routes that have changed since the most recent regular (non-triggered) update ๐. Triggered updates MUST NOT include routes that have not changed since the most recent regular update ๐ โโ๏ธ.
DISCUSSION
Sending all routes, changed or not, in triggered updates is a no-go ๐ค. Many Internet routing tables are huge, so that would waste a ton of bandwidth on triggered updates ๐.
Use of UDP: [ROUTE:3], page 18-19.
RIP packets sent to an IP broadcast address SHOULD have their initial TTL set to one ๐ก.
Also, to comply with Section [6.1] of this memo, a router SHOULD use UDP checksums in the RIP packets it originates. It MUST discard RIP packets received with invalid UDP checksums, but it MUST NOT discard received RIP packets just because they don't contain UDP checksums ๐. Those are different things, and the difference matters ๐ .
Addressing Considerations: [ROUTE:3], page 22
A RIP implementation SHOULD support host routes ๐ฅ๏ธ. If it doesn't, it MUST ignore host routes in received updates (as described on page 27 of [ROUTE:3]). A router MAY log ignored host routes ๐.
The special address 0.0.0.0 is used to describe a default route โจ. A default route is the route of last resort, used when there's no route to the specific net in the routing table ๐. The router MUST be able to create a RIP entry for the address 0.0.0.0 ๐ฏ.
Input Processing - Response: [ROUTE:3], page 26
When processing an update, the following validity checks MUST be performed ๐:
- The response MUST be from UDP port 520.
- The source address MUST be on a directly connected subnet (or on a directly connected, non-subnetted network) to be considered valid.
- The source address MUST NOT be one of the router's addresses.
DISCUSSION
Some networks, media, and interfaces let a sending node receive the packets it broadcasts ๐. A router must not accept its own packets as valid routing updates and process them. The last check stops a router from accepting its own routing updates and processing them, on the assumption that some other router on the network sent them ๐ช.
An implementation MUST NOT replace an existing route if the metric received is equal to the existing metric, except in accordance with the following heuristic ๐ โโ๏ธ.
An implementation MAY choose to implement the following heuristic for that situation ๐งช. Normally, it's pointless to switch the route to a network from one router to another when both are advertised at the same metric. But the route one of the routers is advertising might be in the middle of timing out. Instead of waiting for it to time out, the new route can be used after a specified amount of time has passed โ. If this heuristic is implemented, it MUST wait at least halfway to the expiration point before the new route is installed ๐ซ .
F.2.3 Specific Issues
RIP Shutdown
An implementation of RIP SHOULD provide for a graceful shutdown using these steps ๐:
- Input processing is terminated.
- Four updates are generated at random intervals of between two and four seconds. These updates contain all routes that were previously announced, but with some metric changes. Routes that were being announced at a metric of infinity should continue to use this metric. Routes that had been announced with a non-infinite metric should be announced with a metric of 15 (infinity - 1) ๐.
DISCUSSION
The metric used above really ought to be 16 (infinity) ๐ค. Setting it to 15 is a kludge, and it's there to avoid breaking certain old hosts that wiretap the RIP protocol ๐. Those hosts will (erroneously) abort a TCP connection if they try to send a datagram on it while they have no route to the destination. That can happen even if the no-route period only lasts a few seconds while RIP picks an alternate path ๐ญ.
RIP Split Horizon and Static Routes
Split horizon SHOULD be applied to static routes by default ๐งญ. An implementation SHOULD provide a way to specify, per static route, that split horizon should not be applied to that route ๐๏ธ.
F.3 GATEWAY TO GATEWAY PROTOCOL - GGP
The Gateway to Gateway protocol is considered obsolete and SHOULD NOT be implemented ๐ชฆ๐.
Acknowledgments โจ
okay so the RFC opens with a whole Shakespeare monologue ๐ญ (Henry V, the "band of brothers" speech, iykyk). It's a lot, but the vibes are unmatched, so here it is verbatim:
O that we now had here
But one ten thousand of those men in England
That do no work to-day!
What's he that wishes so?
My cousin Westmoreland? No, my fair cousin:
If we are mark'd to die, we are enow
To do our country loss; and if to live,
The fewer men, the greater share of honour.
God's will! I pray thee, wish not one man more.
By Jove, I am not covetous for gold,
Nor care I who doth feed upon my cost;
It yearns me not if men my garments wear;
Such outward things dwell not in my desires:
But if it be a sin to covet honour,
I am the most offending soul alive.
No, faith, my coz, wish not a man from England:
God's peace! I would not lose so great an honour
As one man more, methinks, would share from me
For the best hope I have. O, do not wish one more!
Rather proclaim it, Westmoreland, through my host,
That he which hath no stomach to this fight,
Let him depart; his passport shall be made
And crowns for convoy put into his purse:
We would not die in that man's company
That fears his fellowship to die with us.
This day is called the feast of Crispian:
He that outlives this day, and comes safe home,
Will stand a tip-toe when the day is named,
And rouse him at the name of Crispian.
He that shall live this day, and see old age,
Will yearly on the vigil feast his neighbours,
And say 'To-morrow is Saint Crispian:'
Then will he strip his sleeve and show his scars.
And say 'These wounds I had on Crispin's day.'
Old men forget: yet all shall be forgot,
But he'll remember with advantages
What feats he did that day: then shall our names.
Familiar in his mouth as household words
Harry the king, Bedford and Exeter,
Warwick and Talbot, Salisbury and Gloucester,
Be in their flowing cups freshly remember'd.
This story shall the good man teach his son;
And Crispin Crispian shall ne'er go by,
From this day to the ending of the world,
But we in it shall be remember'd;
We few, we happy few, we band of brothers;
For he to-day that sheds his blood with me
Shall be my brother; be he ne'er so vile,
This day shall gentle his condition:
And gentlemen in England now a-bed
Shall think themselves accursed they were not here,
And hold their manhoods cheap whiles any speaks
That fought with us upon Saint Crispin's day.
-- William Shakespeare
Now for the real thanks ๐. This memo is the product of the IETF's Router Requirements Working Group ๐ธ. A memo like this is literally the work of way more people than could fit on one page. A whole bunch of vendors, network managers, and other experts from the Internet community gave their time and wisdom to make it better, and the editor is so grateful to every one of them ๐ซถ
The current editor also wants to single out the original editor, Philip Almquist, because without Philip, both as original editor and as the working group's Chair, this document would literally not exist ๐. The editor is also deeply grateful to the previous editor, Frank Kastenholz ๐. Frank turned the original doc from a pile of information into a genuinely useful description of IP technology. In his words, it was a "snapshot" of the tech in 1991. The hope is that this snapshot, of the tech in 1994, is just as clear ๐ฆ
Philip Almquist, Jeffrey Burgan, Frank Kastenholz, and Cathy Wittbrodt each wrote major chapters ๐ฅ. Other big contributors included Bill Barns, Steve Deering, Kent England, Jim Forster, Martin Gross, Jeff Honig, Steve Knowles, Yoni Malachi, Michael Reilly, and Walt Wimer.
Additional text came from Andy Malis, Paul Traina, Art Berggreen, John Cavanaugh, Ross Callon, John Lekashman, Brian Lloyd, Gary Malkin, Milo Medin, John Moy, Craig Partridge, Stephanie Price, Yakov Rekhter, Steve Senum, Richard Smith, Frank Solensky, Rich Woundy, and others who got accidentally left off the list ๐.
Some of the text in this memo was (shamelessly ๐) plagiarized from earlier documents, most notably RFC-1122 by Bob Braden and the Host Requirements Working Group, and RFC-1009 by Bob Braden and Jon Postel. The work of these earlier authors is gratefully acknowledged ๐.
Jim Forster was a co-chair of the Router Requirements Working Group during its early meetings, and was key to getting the group off to a good start ๐ง. Jon Postel, Bob Braden, and Walt Prue also helped a ton by sharing loads of good advice before the group's first meeting. Later on, Phill Gross, Vint Cerf, and Noel Chiappa all gave valuable advice and support.
Mike St. Johns coordinated the Working Group's interactions with the security community, and Frank Kastenholz coordinated its interactions with the network management area. Allison Mankin and K.K. Ramakrishnan brought the expertise on congestion control and resource allocation ๐ .
Way more people than could possibly be listed here took part in the Router Requirements Working Group's deliberations, whether over electronic mail or by showing up to meetings. Still, the efforts of Ross Callon and Vince Fuller in sorting out the difficult issues of route choice and route leaking are especially acknowledged ๐.
The editor thanks his employer, Cisco Systems, for letting him spend the time needed to produce the 1994 snapshot โจ.
Editor's Address ๐
Here's where to find the current editor, verbatim:
The address of the current editor of this document is
Fred Baker
Cisco Systems
519 Lado Drive
Santa Barbara, California 93111
USA
Phone:+1 805-681-0115
EMail: fred@cisco.com
๐ฆ where this page comes from
- ietf: rfc1812 1995-06
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms