html5-img
1 / 79

COMS/CSEE 4140 Networking Laboratory Lecture 06

COMS/CSEE 4140 Networking Laboratory Lecture 06. Salman Abdul Baset Spring 2008. Announcements. Lab 4 (5-7) due next week before your lab slot Prelab 5 due next week. There will be Lab 5 next week. Midterm (March 10 th , duration ~1.5 hours) Assignment 2 issues aslookup compilation?

pancho
Download Presentation

COMS/CSEE 4140 Networking Laboratory Lecture 06

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COMS/CSEE 4140 Networking LaboratoryLecture 06 Salman Abdul Baset Spring 2008

  2. Announcements • Lab 4 (5-7) due next week before your lab slot • Prelab 5 due next week. • There will be Lab 5 next week. • Midterm (March 10th, duration ~1.5 hours) • Assignment 2 issues • aslookup compilation? • ISP name: nslookup or whois for IP address • Lab 4 (count-to-infinity issues)

  3. Agenda • Autonomous Systems (AS) • Policy vs. distance based routing • Border gateway protocol (BGP) • Transmission control protocol (TCP)

  4. Autonomous Systems Terminology • local traffic = traffic with source or destination in AS • transit traffic = traffic that passes through the AS • Stub AS = has connection to only one AS, only carry local traffic • Multihomed AS = has connection to >1 AS, but does not carry transit traffic • Transit AS = has connection to >1 AS and carries transit traffic

  5. AS 1, AS 2, and AS 5 are stub networks AS 2 is a multi-homed stub network AS 3 and AS 4 are transit networks Stub and Transit Networks

  6. Example: Transit AS 3 carries traffic between AS 1 and AS 4 and between AS 2 and AS 4 But AS 3 does not carry traffic between AS 1 and AS 2 The example shows a routing policy. Selective Transit

  7. A stub network typically obtains access to the Internet through a transit network. Transit network that is a provider may be a customer for another network Customer pays provider for service Customer/Provider

  8. Transit networks can have a peer relationship Peers provide transit between their respective customers Peers do not provide transit between peers Peers normally do not pay each other for service Customer/Provider and Peers

  9. Note that peering reduces upstream traffic Delays can be reduced through peering But: Peering may not generate revenue Shortcuts through peering

  10. ASNs already assigned Source: http://www.potaroo.net/tools/asn32/ private ASN: 65412 – 65536

  11. ASNs in use

  12. ASN projections

  13. ARDs versus ASes Autonomous Routing Domains Don’t Always Need BGP or an ASN Qwest Nail up routes 130.132.0.0/16 pointing to Yale Nail up default routes 0.0.0.0/0 pointing to Qwest Yale University 130.132.0.0/16 Static routing is the most common way of connecting an autonomous routing domain to the Internet. This helps explain why BGP is a mystery to many …

  14. ASNs Can Be “Shared” (RFC 2270) AS 701 UUNet AS 7046 Crestar Bank AS 7046 NJIT AS 7046 Hood College 128.235.0.0/16 ASN 7046 is assigned to UUNet. It is used by Customers single homed to UUNet, but needing BGP for some reason (load balancing, etc..) [RFC 2270]

  15. ARDs and ASes: Summary • Most ARDs have no ASN (statically routed at Internet edge) • Some unrelated ARDs share the same ASN (RFC 2270) • Some ARDs are implemented with multiple ASNs (example: Worldcom) ASes are just an implementation detail of Inter-domain routing

  16. Agenda • Autonomous Systems (AS) • Policy vs. distance based routing • Border gateway protocol (BGP) • Transmission control protocol (TCP)

  17. National ISP1 National ISP2 YES NO Regional ISP3 Regional ISP2 Regional ISP1 Cust1 Cust3 Cust2 Why not minimize “AS hop Count”? Shortest path routing is not compatible with commercial relations

  18. provider customer IP traffic Customer versus Provider provider customer Customer pays provider for access to the Internet

  19. Peers provide transit between their respective customers Peers do not provide transit between peers Peers (often) do not exchange $$$ traffic allowed traffic NOT allowed peer peer provider customer The “Peering” Relationship

  20. Peering also allows connectivity between the customers of “Tier 1” providers. peer peer provider customer Peering Provides Shortcuts

  21. Reduces upstream transit costs Can increase end-to-end performance May be the only way to connect your customers to some part of the Internet (“Tier 1”) You would rather have customers Peers are usually your competition Peering relationships may require periodic renegotiation Peering Wars Peer Don’t Peer Peering struggles are by far the most contentious issues in the ISP world! Peering agreements are often confidential.

  22. Agenda • Autonomous Systems (AS) • Policy vs. distance based routing • Border gateway protocol (BGP) • Transmission control protocol (TCP)

  23. Link State Vectoring OSPF RIP IGP IS-IS BGP EGP The Gang of Four

  24. BGP Overview • BGP = Border Gateway Protocol v4 . RFC 1771. (~ 60 pages) • Note: In the context of BGP, a gateway is nothing else but an IP router that connects autonomous systems. • Interdomain routing protocol for routing between autonomous systems. • Uses TCP to establish a BGP session and to send routing messages over the BGP session. • Update only new routes. • BGP is a path vector protocol. Routing messages in BGP contain complete routes. • Network administrators can specify routing policies.

  25. BGP Policy-based Routing • Each node is assigned an AS number (ASN) • BGP’s goal is to find any AS-path (not an optimal one). Since the internals of the AS are never revealed, finding an optimal path is not feasible. • Network administrator sets BGP’s policies to determine the best path to reach a destination network.

  26. The Border Gateway Protocol (BGP) BGP = RFC 1771 + “optional” extensions RFC 1997 (communities) RFC 2439 (damping) RFC 2796 (reflection) RFC3065 (confederation) … + routing policy configuration languages (vendor-specific) + Current Best Practices in management of Interdomain Routing BGP was not DESIGNED. It EVOLVED.

  27. BGP Route Processing Open ended programming. Constrained only by vendor configuration language Apply Policy = filter routes & tweak attributes Apply Policy = filter routes & tweak attributes Receive BGP Updates Based on Attribute Values Best Routes Transmit BGP Updates Apply Import Policies Best Route Selection Best Route Table Apply Export Policies Install forwarding Entries for best Routes. IP Forwarding Table

  28. BGP Attributes Value Code Reference ----- --------------------------------- --------- 1 ORIGIN [RFC1771] 2 AS_PATH [RFC1771] 3 NEXT_HOP [RFC1771] 4 MULTI_EXIT_DISC [RFC1771] 5 LOCAL_PREF [RFC1771] 6 ATOMIC_AGGREGATE [RFC1771] 7 AGGREGATOR [RFC1771] 8 COMMUNITY [RFC1997] 9 ORIGINATOR_ID [RFC2796] 10 CLUSTER_LIST [RFC2796] 11 DPA [Chen] 12 ADVERTISER [RFC1863] 13 RCID_PATH / CLUSTER_ID [RFC1863] 14 MP_REACH_NLRI [RFC2283] 15 MP_UNREACH_NLRI [RFC2283] 16 EXTENDED COMMUNITIES [Rosen] ... 255 reserved for development Most important attributes Not all attributes need to be present in every announcement From IANA: http://www.iana.org/assignments/bgp-parameters

  29. LOCAL_PREF Attribute Forces outbound traffic to take primary link, unless link is down.

  30. NEXT_HOP Attribute • EGP: IP address used to reach the advertising router • IGP: next-hop address is carried into local AS

  31. AS_PATH Attribute • Used to detect routing loops and find shortest paths

  32. Shedding Inbound Traffic with ASPATH Prepending Prepending will (usually) force inbound traffic from AS 1 to take primary link AS 1 provider 192.0.2.0/24 ASPATH = 2 2 2 192.0.2.0/24 ASPATH = 2 primary backup customer 192.0.2.0/24 AS 2 Yes, this is a Glorious Hack …

  33. … But Padding Does Not Always Work AS 1 AS 3 provider provider 192.0.2.0/24 ASPATH = 2 192.0.2.0/24 ASPATH = 2 2 2 2 2 2 2 2 2 2 2 2 2 AS 3 will send traffic on “backup” link because it prefers customer routes and local preference is considered before ASPATH length! Padding in this way is often used as a form of load balancing primary backup customer 192.0.2.0/24 AS 2

  34. COMMUNITY Attribute to the Rescue! AS 3: normal customer local pref is 100, peer local pref is 90 AS 1 AS 3 provider provider 192.0.2.0/24 ASPATH = 2 COMMUNITY = 3:70 192.0.2.0/24 ASPATH = 2 primary backup Customer import policy at AS 3: If 3:90 in COMMUNITY then set local preference to 90 If 3:80 in COMMUNITY then set local preference to 80 If 3:70 in COMMUNITY then set local preference to 70 customer 192.0.2.0/24 AS 2

  35. ¾ wedgie BGP Issues - What is a BGP Wedgie? • BGP policies make sense locally • Interaction of local policies allows multiple stable routings • Some routings are consistent with intended policies, and some are not • If an unintended routing is installed (BGP is “wedged”), then manual intervention is needed to change to an intended routing • When an unintended routing is installed, no single group of network operators has enough knowledge to debug the problem Full wedgie

  36. YouTube blocking • Pakistan blocks YouTube • How? (according to BBC) • Advertise a shorter route to reach YouTube • The incorrect short route gets propagated • Seen by two thirds of the Internet • Traffic to YouTube goes through Pakistan • Since Pakistan blocked YouTube, all traffic reaches a dead end!

  37. Dynamic Routing Protocols: Summary • Dynamic routing protocols: RIP, OSPF, BGP • RIP uses distance vector algorithm, and converges slow (the count-to-infinity problem) • OSPF uses link state algorithm, and converges fast. But it is more complicated than RIP. • Both RIP and OSPF finds lowest-cost path. • BGP uses path vector algorithm, and its path selection algorithm is complicated, and is influenced by policies. • BGP has its own problems see WIDGI by Tim Griffin

  38. More Readings (Optional) • BGP Wedgies: Bad Routing Policy Interactions that Cannot be Debugged • JI’s Intro to interdomain routing. • "Interdomain Setting of PlanetLab Nodes." PlanetLab Meeting, May 14, 2004. • Understanding the Border Gateway Protocol (BGP) • ICNP 2002 Tutorial Session

  39. Agenda • Autonomous Systems (AS) • Policy vs. distance based routing • Border gateway protocol (BGP) • Transmission control protocol (TCP)

  40. Transmission Control Protocol (RFC) • Reliable and in-order byte-stream service • TCP format • Connection establishment • Flow control • Reaction to congestion • Packet corruption

  41. TCP Format • TCP segments have a 20 byte header with >= 0 bytes of data.

  42. TCP header fields • Sequence Number (SeqNo): • Sequence number is 32 bits long. • So the range of SeqNo is 0 <= SeqNo <= 232 -1  4.3 Gbyte • Each sequence number identifies a byte in the byte stream • Initial Sequence Number (ISN) of a connection is set during connection establishment Q: What are possible requirements for ISN ?

  43. TCP header fields • Acknowledgement Number (AckNo): • Acknowledgements are piggybacked, i.e., a segment from A -> B can contain an acknowledgement for a data sent in the B -> A direction Q: Why is piggybacking good ? • A hosts uses the AckNo field to send acknowledgements. (If a host sends an AckNo in a segment it sets the “ACK flag”) • The AckNo contains the next SeqNo that a hosts wants to receiveExample: The acknowledgement for a segment with sequence numbers 0-1500 is AckNo=1501

  44. TCP header fields • Acknowledge Number (cont’d) • TCP uses the sliding window flow protocol (see CS 457) to regulate the flow of traffic from sender to receiver • TCP uses the following variation of sliding window: • no NACKs (Negative ACKnowledgement) • only cumulative ACKs • Example: Assume: Sender sends two segments with “1..1500” and “1501..3000”, but receiver only gets the second segment. In this case, the receiver cannot acknowledge the second packet. It can only send AckNo=1

  45. TCP header fields • Header Length ( 4bits): • Length of header in 32-bit words • Note that TCP header has variable length (with minimum 20 bytes)

  46. TCP header fields • Flag bits: • URG: Urgent pointer is valid • If the bit is set, the following bytes contain an urgent message in the range:SeqNo <= urgent message <= SeqNo+urgent pointer • ACK: Acknowledgement Number is valid • PSH: PUSH Flag • Notification from sender to the receiver that the receiver should pass all data that it has to the application. • Normally set by sender when the sender’s buffer is empty

  47. TCP header fields • Flag bits: • RST: Reset the connection • The flag causes the receiver to reset the connection • Receiver of a RST terminates the connection and indicates higher layer application about the reset • SYN: Synchronize sequence numbers • Sent in the first packet when initiating a connection • FIN: Sender is finished with sending • Used for closing a connection • Both sides of a connection must send a FIN

  48. TCP header fields • Window Size: • Each side of the connection advertises the window size • Window size is the maximum number of bytes that a receiver can accept. • Maximum window size is 216-1= 65535 bytes • TCP Checksum: • TCP checksum covers over both TCP header and TCP data (also covers some parts of the IP header) • 16-bit one’s complement • Urgent Pointer: • Only valid if URG flag is set

  49. TCP header fields • Options:

  50. TCP header fields • Options: • NOP is used to pad TCP header to multiples of 4 bytes • Maximum Segment Size • Window Scale Options • Increases the TCP window from 16 to 32 bits, i.e., the window size is interpreted differently Q: What is the different interpretation ? • This option can only be used in the SYN segment (first segment) during connection establishment time • Timestamp Option • Can be used for roundtrip measurements

More Related