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 Subnet mask: 255.255.255.128 Subnet number: 188.8.131.52 <SubnetNumber, 184.108.40.206 220.127.116.11 SubnetMask, NextHop> H1 R1 18.104.22.168 Subnet mask: 255.255.255.128 28 Subnet number: 22.214.171.124 28 • Router ANDs dest addr 126.96.36.199 with subnet mask of each 188.8.131.52 H3 R2 H2 entry. 184.108.40.206 220.127.116.11 • Find the right entry (Match Subnet mask: 255.255.255.0 Subnet number: 18.104.22.168 with subnet no.) and forward to Next hop. Subnet Number Subnet Mask Next Hop 22.214.171.124 255.255.255.128 Int 0 126.96.36.199 255.255.255.128 Int 1 Router R1’s 188.8.131.52 255.255.255.0 R2 table 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 gateway (adv ertises path to Regional network 11000000000001) 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 184.108.40.206, 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: 220.127.116.11 ISP 2 ISP 2 would advertise 18.104.22.168 22.214.171.124 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 ISP “Consumer” Peering point Backbone service provider Peering point ISP “Consumer” Large corporation I “Consumer”SP Small corporation Stub AS -- Service Provider Networks only local traffic 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 128.96 (AS 4) 192.4.153 Regional prov ider A (AS 2) Customer Q 192.4.32 (AS 5) 192.4.3 Backbone network (AS 1) Customer R 192.12.69 (AS 6) Regional prov ider B (AS 3) Customer S 192.4.54 (AS 7) 192.4.23 • 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. 0 15 • For more detail look at book. Unf easible routes length • Important thing --- BGP Withdrawn routes (v ariable) updates are of the type prefix/length Total path attribute length – 192.4.16/20 Path attributes • Note that forwarding entries (v ariable) Network lay er can also be similarly reachability inf o represented. (v ariable) 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. Area 1 Area 3 • Subdomains of larger domains. Area 0 R9 R7 • One special area called R8 R1 R3 R4 backbone area. (Area 0). R2 • Within each area -- link state Area 2 routing. R6 R5 • Link state advertisements of non border routers do not leave area. • A router that is a • Packet goes from non-backbone member of both the area to backbone area and crosses the backbone into the backbone and a non- Internet. backbone 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.