CS 164: Global Internet Slide Set -- 11 In this set ... • More about subnets • Classless Inter Domain Routing (CIDR) • Border Gateway Protocol (BGP) • Areas with OSPF Forwarding on Subnets • Resolution of subnet address: Bitwise ANDing Host IP address with Subnet Mask gives subnet number. • When a host wants to send an IP packet: – Perform BITwise AND between subnet mask and destination IP address • If result == its subnet no. destination is on same subnet (Send ARP etc.). – If not, send packet to default router R. Router Forwarding Tables • Table holds entries like <SubnetNumber, SubnetMask, NextHop> • Router ANDs dest addr with subnet mask of each entry. • Find the right entry (Match with subnet no.) and forward to Next hop. Subnet Number Subnet mask: 255.255.255.128 Subnet number: 128.96.34.0 128.96.34.15 128.96.34.1 R1 H1 Subnet mask: 255.255.255.128 28 Subnet number: 128.96.34.128 28 128.96.34.130 128.96.34.139 128.96.34.129 H3 R2 H2 128.96.33.1 128.96.33.14 Router R1’s table Subnet mask: 255.255.255.0 Subnet number: 128.96.33.0 Subnet Mask Next Hop 128.96.34.0 255.255.255.128 Int 0 128.96.34.128 255.255.255.128 Int 1 128.96.33.0 255.255.255.0 R2 Other Issues • Subnet Mask need not align with byte boundaries (e.g. 255.255.255.128) -- 7 zeroes. • Non contiguous masks are possible -255.255.1.0 -- however, this makes administration difficult -- not recommended. • One could have multiple subnets on the same physical network ! However, now, hosts on the same net would need to go through a router in order to talk to each other. Outside View • Routers outside a group of subnets see the group as a single network - e.g. 128.96 • However, once packet arrives to the group, routers within the group need to forward the packets to the proper subnet. Classless Interdomain Routing • Abbreviated as CIDR. • If a network grows to more than 255 hosts, it may want a Class B address. • One possible way of avoiding is to handle many Class C routing addresses -- but then, for this one network, each router has to maintain multiple routing entries. • CIDR is an attempt to balance the desire to minimize the number of routes that a router needs to know versus the need to hand out addresses efficiently. • Key property: CIDR enables aggregation of routes ! Removing rigid boundaries • The idea is to break the rigid boundaries between classes. • As an example, if a network grows to about 16x255 hosts, assign a contiguous “block” of Class C addresses as opposed to a Class B address. – Example: 192.4.16 to 192.4.31 • Note -- 16 Class C addresses better than 1 Class B in terms of address efficiency. • In the above example -- the top 20 bits are the same for all the addresses and so we have effectively created a 20 bit network number ! The Prefix • The 20 bit address in our previous example is called the “common prefix” for the set of addresses that are allocated. • Observe -- what we did was that we allocated a block of Class C addresses that shared a common prefix. • Now, with this new representation, the network numbers are represented by <length,value> -- the length represents the number of bits in the prefix. Subnets vs CIDR • The concept is similar but: – In a subnet, a single address is shared among multiple physical networks. – With CIDR, we collapse multiple network addresses into a longer network address that is typically assigned to an AS (the single AS would have a network number or prefix that reflects the block of addresses). • Thus, when we want to route to “any” of the networks or even subnets within the AS, we route to the AS. Route Aggregation • Specifying simply the prefix associated with an AS (as opposed to stating the subnet number explicitly) is called route aggregation. • When sending route advertisements (we will see how), it suffices to simply advertise “common prefixes”. • Note that for this, careful planning would be needed. An Example • Border gateway advertises the common prefix only! Corporation X (11000000000001000001) Border gatew ay (advertises path to 11000000000001) Regional netw ork Corporation Y (11000000000001000000) Longest Prefix Match • Prefixes may overlap: – Example 171.69 and 171.69.10 may be found in the forwarding table of a single router. – Now, if the destination is 179.69.10.7, both the prefixes match ! – Policy -- Choose the longest prefix. why ? • Choosing the longest prefix the right choice since an organization may switch ISPs. ISP 1: 223.1.1.0 223.1.1.240 ISP 2 ISP 2 would advertise 223.1.1.240 explicitly Revisiting Autonomous Systems • ASes provide an additional way of hierarchically aggregating routing information in the Internet. • AS --> also called domains and can run their own protocols within their administrative regimes. • In each AS, the amount of routing information may be dramatically reduced by using a default router. • If the corporate network is connected to the Internet by means of a single border router nodes simply send messages to this router. Internet View Revisited Multihomed -- no transit traffic. Large corporation “Consumer”ISP Peering point Backbone service provider “Consumer”ISP Large corporation Peering point “Consumer”ISP Small corporation Stub AS -only local traffic Service Provider Networks Some notation • Peering Point: Points where different providers interconnect. • Local Traffic: Traffic that begins and terminates on nodes within an AS. • Transit traffic -- passes through various Ases -- backbones carry transit traffic. Exterior Gateway Protocol • Abbreviated as EGP – – – – Hierarchical routing Reach higher level in the hierarchy Tree structure for routing topology. No peer-to-peer communications. Border Gateway Protocol • Abbreviated BGP -- currently version 4 and is in use. • Rather complex. • Goals of BGP are modest: – Any loop free path is to be found between the source and destination (not necessarily min cost or shortest). Why the modest goal ? • Each AS may have a different set of nodes, so it is unclear which route is the min-cost route! – Route aggregation also difficult • Lots of routing information is required in order to guarantee optimality -- may be infeasible. • Trust -- misconfiguration may not yield optimal. BGP Details • BGP supports flexibility -- paths could be chosen by a provider based on a policy. • To configure BGP, each AS admin picks at least one node to be the “BGP” speaker -- a spokesperson node for the entire AS. – The BGP speaker establishes a BGP session with other BGP speakers in other ASes. • In addition, there are border gateways using which packets enter/leave ASes. • Source advertises complete paths (unlike distance vector or link state routing) -- thus loops are prevented. An Example Customer P (AS 4) 128.96 192.4.153 Customer Q (AS 5) 192.4.32 192.4.3 Customer R (AS 6) 192.12.69 Customer S (AS 7) 192.4.54 192.4.23 Regional provider A (AS 2) Backbone netw ork (AS 1) Regional provider B (AS 3) • AS 2 says 128.96, 192.4.15, 192.4.32, 192.4.3 can be reached via AS 2. • AS 1 advertises that these networks can be reached via <AS1, AS2> --note full path description. • Loops are avoided. AS Numbers • Each AS is assigned a number -16 bits and is unique. – The uniqueness requirement has been relaxed to some extent --stub ASes do not need to be unique. • One could have up to 65 K AS numbers. BGP Messages • BGP has four types of messages – OPEN: Establish a connection with a BGP peer • Note: BGP connection is TCP based ! (Port no. 179). – UPDATE -- advertise or withdraw routes to a destination • Note --BGP speaker needs to be able to cancel previously advertised paths if nodes or links fail. This form of negative advertisements are said to advertise “withdrawn routes”. BGP Messages (cont) • KEEPALIVE: Inform a peer that the sender is still alive but has no information to send. • NOTIFICATION: Notify that errors are detected. BGP Message Format • 16 byte fields. • For more detail look at book. • Important thing --- BGP updates are of the type prefix/length – 192.4.16/20 • Note that forwarding entries can also be similarly represented. 0 15 Unfeasible routes length Withdraw n routes (variable) Total path attribute length Path attributes (variable) Netw ork layer reachability info (variable) Routing with BGP • For stub AS -- border router injects a default route into the intra-domain routing protocol. • If there are more than one border router, each injects specific routes that they have learned from outside the AS. • IBGP or Interior BGP is used to distribute the information to all other routers in the domain (and the speaker). Routing Areas • Especially used with OSPF. • Subdomains of larger domains. • One special area called backbone area. (Area 0). • Within each area -- link state routing. • Link state advertisements of non border routers do not leave area. • Packet goes from non-backbone area to backbone area and crosses the backbone into the Internet. Area 3 Area 1 Area 0 R9 R7 R8 R3 R1 R4 R2 Area 2 R6 R5 • A router that is a member of both the backbone and a nonbackbone area (R1) is called a area router. Areas (continued) • Border routers “summarize” routing information and make it available to other areas -- act like proxies --reflect costs to reach networks from an area. • When there are many possible routes, routers choose cost info to forward packets. • Trade-offs -- Optimality versus scalability - All packet have to pass through the backbone area (may not be optimal). Next Time • IPv6 • Introduction to the transport layer.