Thursday, November 22, 2012

Notes - The Network Layer in the Internet

The following are notes from Tanenbaum's Computer Networks 5th Edition.
  • Principles of Network Layer Design
    • Make sure it works
      • do not finalize until approved
    • Keep it simple
    • Make clear choices
      • choose options rather than allowing for several ways to do the same thing
    • Exploit modularity
      • independent layers
    • Expect heterogeneity
    • Avoid static options and parameters
    • Look for a good design over a perfect one
    • Be strict when sending and tolerant when receiving
    • Thin about scalability
    • Consider performance and cost
  • ASes(Autonomous systems)
    • connection of internetworks
  • Tier 1 networks are ISPs
  • following shows connections
  • IP(Internet Protocol)
    • glues together internet with similarities
The IP Version 4 Protocol

  • Version field keeps track of which version of the protocol datagram belongs too
  • IHL is provided to tell how long the header is
  • Differentiated services field changed its meaning over the years
    • originally type of service field
  • Total length includes the entire datagram max length 65,535 bytes
  • Identification field shows the host where the packet should go, where ti belongs to
  • MF is more fragments all fragments except the last one have this bit sets, lets us know when all the fragments of a datagram has arrived
  • Fragment offset tells where in the current packet the fragment belongs
  • TtL is used to limit packet lifetimes
    • counts number of hops
  • protocol tells the transport process
  • header checksum crc assumed to be 0 on arrival
  • source/destination address is IP address
  • options field is to allow subsequent version of the protocol to include information
  • security tells how secret info is, military use
  • strict source routing option gives complete path
  • losse source routing gives packet ability to traverse the list of routers specified
  • network measurement
    • record route tells each router to append its ip address to options field
    • timestamp option records the 32 bit timestamp
IP Addresses
  • Prefix ip addresses are hierarchal, unlike ethernet
  • dotted decimal notation
  • subnet mask, prefixes described by their length
  • Subnets
    • ICANN(Internet Corporation for Assigned Names and Numbers)
      • network numbers manager
    • splitting prefix example
  • CIDR - Classless InterDomain Routing
    • routers must be able to determine path from each source to each destination
    • tables growing larger and larger
    • however, can group into subnets, route aggregation
    • CIDR (Classless Inter- Domain Routing)
      • router routes between same prefix routers
      • when packet comes in routing table is scanned to see if destination lies within prefix
      • possible multiple entries will match longest prefix used
      • commercial routers use custom VLSI chips with algorithms embedded into hardware
  • Classful and Special Addressing
    • A allows for up to 128 networks with 16 million hosts
    • B allows for up to 16,384 networks with 2 million hosts
    • C allows for up to 2 million networks with 256 million hosts
    • 3 bears problem, since B is the only network that makes sense for scalability for a company or organization
    • Class D networks are being for multicast
  • NAT - Network Address Translation
    • IP adress are scarce
    • dynamically assign IP address to a computer when it is on
    • beginning to apply to home users subscribing to ADSL or internet over cable
    • problem of running out of IP addresses, solution is to move to IPv6 but this is slowly occurring
    • in the meantime we use NAT(Network Address Translation)
      • assign each home or business with a single ip address
      • within the customer network each computer gets a unique ip address
      • these addresses are unavailable
  • Operation of NAT
    • before packets leave a customer it passes through a NAT box that converts the internal IP to the customer's true IP address
    • how does provider send back to customer?
      • observed that most IP packets carry TCP or UDP payloads
      • contain source destination port
      • ports indicate where the TCP connection begins and ends, so we can establish port to port processes rather than ip to ip processes
    • ports 0-1023 are reserved, but 1024-65,535 are available for use, so each IP gets this many ports utilized to solve the mapping issue
    • issues about using NAT
      • breaks end to end connectivity as an outgoing packet is necessary before incoming packets can be allowed
      • home user with NAT can make TCP/IP connections to remote web server, but remote user cannot make connections to game server on home network without NAT traversal techniques
      • changes from connectionless to connection oriented in an odd way
      • violates protocol layering, assumes TCP operational, if TCP is upgraded to a new style, NAT will fail
      • processes are not required to use TCP or UDP, if new transport protocol used, NAT cannot handle
      • FTP inserts IP addresses into the body of packet, but it cannot rewrite the IP addresses here
IP Version 6
  • Goals
    • support billions of hosts
    • reduce size of routing table
    • simplify protocol
    • provide better security
    • pay more attention to type of service
    • aid multicasting by allowing scopes to be specified
    • make it possible for hosts to roam
    • allow protocol evolution
    • permit old and new protocol to coexist until old can be phased out
  • SIPP(Simple Internet Protocol Plus) became IPv6
  • The Main IPv6 header
    • differentiated services distinguishes class of packets
    • flow label provides way for source and destination to mark groups of packets
    • payload length tells how many bytes follow header
    • next header can be optional extension headers, tells transport packets such as the handler where it should pass to next
    • Hop limit is Time to live, same idea
    • source address destination address with 16 byte addresses
      • IPv4 are designated by double collons
      • address space so large it won't be used efficiently but its unlikely to run out as there are 1000 IP addresses per square meter of the earth
  • Extension Headers
  • IPv6 allows for jumbo payload lengths that are used to transmit gigabyte sized packets across internet
  • Controversies
    • address length compromise
    • hop limit field limited to 255 current technology
    • remove the IPv4 checksum
      • reasoning is that application would have transport layer checksum anyway so no point in doing this over again
    • Deployment is the difficulty with IPv6 slow conversion in small islands of IPv6
Internet Control Protocols
  • ICMP(Internet Control message protocol) message types are listed as follows
  • Time exceeded error message used to create traceroute utility that finds the routers along the paths to a destination, send sequence of packets with counters to reach 0 each time along the packet
  • ARP - The Address Resolution Protocol
    • Data link layer NICs such as ethernet cards don't understand Internet Addresses
    • host 1 outputs a broadcast packet on ethernet to see who owns an IP address
    • host 2 responds with its ethernet address
    • defined in RFC
    • gratuitous ARP
      • have every machine broadcast its mapping when configured, make update or entry in everyone's ARP, if error occurs resolved by network manager
    • default gateway
      • router where off network traffic is sent
    • possible to send packet from host to host using proxies, so unable to give direct replies, but can set a router to forward to another network
  • DHCP - The Dynamic Host Configuration Protocol
    • when computer is started built in Ethernet or link layer address in NIC but no IP
    • broadcasts request for IP DHCP DISCOVER packet, which much reach DHCP server
    • then it tells the server where it is located
    • IP address assignment may be only for a fixed period of time, leasing
Label Switching and MPLS
  • MPLS (MultiProtocol Label Switching)
    • connection oriented network
    • adds a label in front of each packet and forwarding is based on label instead of destination address
    • tag switching
    • Label field holds the index
    • QoS indicates class of service
    • S refers to stacking multiple layers
    • TtL is number of hops packet can live
  • MPLS enhanced packet arrives at LSR(Label Switched Router)
    • label is used as an index to determine outgoing line to use
  • forwarding
    • finds best match for a destination address
  • switching
    • uses a label taken from the packet as an index into a forwarding table
    • simpler and faster but not universal definition
  • most hosts don't understand MPLS
  • LER(Label Edge Router)
    • inspects destination IP address and other fields to see what path the MPLS packet should take
    • Flows that belong to the same label are called FEC(Forwarding Equivalence Class)
  • traditionally not possible to group several distinct forwarding paths
  • can operate in multiple levels at once
  • label forwarding tables set up by
    • combining routing and connection setup protocols
    • when router is booted checks to see which routes for final destination
    • creates FECs for each label and pass them to their neighbors
OSPF - An Interior Gateway Routing Protocol
  • OSPF (Open Shortest Path First)
    • became standard in 1990
    • draws on IS-IS(Intermediate System to Intermediate System)
      • became ISO standard
    • goals
      • support variety of distance metrics
      • dynamic algorithm
      • based on type of service
      • load balancing capable
      • support for hierarchical systems
      • security
    • supports point to point links and and broadcast networks
  • abstracts collection of networks routers and links into a directed graph in which each arc is assigned a weight in terms of distance/delay
  • structure routes to hosts but not through them, only through networks such as LANS
  • use a link state method to compute shortest path
    • ECMP(Equal Cost MultiPath)
      • remembers set of shortest path and splits traffic across them equally
  • AS divide itself into numbered areas where an area is a network or set of continuous networks
    • routers that lie in a router are called internal routers
    • each AS has a backbone Area with backbone routers
    • all areas are connected to the backbone
    • each router is connected to two or more areas is called an area border router and is also part of the background
    • if there is only one router out of an area it is called a stub area
  • shortest path algorithms are used in an intra area sense and inter area sense
    • find shortest path from area to area
    • find shortest path from any host/node within an area to another within the area or from border router to any node in area
  • exchange info between adjacent routers, but designates one router as the designated router to be adjacent to all other routers to exchange information so information not duplicated with one backup
  • Message types listed in the following diagram
  • BGP - The Exterior Gateway Routing Protocol
    • BGP(Border Gateway Protocol)
    • between ASes
    • example policies gateway protocols can handle
      • Do not carry commercial traffic on educational network
      • don't send information from pentagon through iraq
      • use TeliaSonera over Verizon
      • don't use AT&T in Australia
      • Apple traffic doesn't transit through Google
    • ISP pay other ISPs to deliver packets, buy transit service
    • interconnections called IXPs(Internet Exchange Points)
    • ASes can do peering where they send each others traffic for free
    • Multihoming
      • company networks connected to multiple ISPs as backup
    • Path Vector Protocol
      • instead of maintaining routes, maintain path to next hop router and sequence of AS that route followed
    • BGP communicates using TCP connections
    • iBGP, eBGP internal or external BGP protocol
      • internal every router at boundary learns all the routes seen by other boundary routers
      • strategies
        • routes via peered networks chosen in preference
        • routes via shortest path chosen
        • routes with lowest cost
          • early exit or hot potato routing
          • tends to make routes asymmetric
Internet Multicasting
  • processes that send from one to a large number of viewers
  • IP supports this due to range of IP addresses
  • IGMP(Internet Group Management Protocol)
    • every about once a minute hosts on LAN reports to a multicast router to identify which group they belong to
  • PIM(Protocol Indpendent Multicast
    • build spanning tree for multicast
      • dense mode pruned reverse path forwarding used
      • sparse mode similar to core based trees
Mobile IP
  • goals
    • each mobile host must be able to use home IP anywhere
    • software changes to fixed host not permitted
    • not permitted to change router software and tables
    • packets should not make detours
    • should not have overhead when mobile host is at home
  • setup a home agent when roaming
    • obtains a new IP address when in a foreign site
    • packet for mobile arrives to home, it will tunnel to new site so mobile can send and reply using its home address instead of where it is at currently
  • options to solve ip address issue
    • create route to specific prefix at moving site, but too many sites possible
    • change IP address of mobile, handles mobility at a higher level but breaks some applications whenever mobile moves
  • mobility can be solved at link layer
    • same as 802.11 wireless network, but degree of mobility is very limited
  • IPv4 solution given in RFC 3344
  • mobiles uses DHCP to get care of IP address at foreign location, finds an agent to get address from using ICMP
  • tunneling achieved using proxy ARP to intercept packets
  • Ingress filtering
    • a security measure to discard addresses that are incorrect, but mobile will have foreign IPs so mobiles have to use care of address to tunnel packets to home location
  • flying router on airplanes is different kind of mobility where the entire network is mobile

No comments:

Post a Comment