network layers

Work in Progress

Summary

Building the packet

LayerPacket formatNeeds
application layermessagethe data itself
transport layersegment -> src & dest ports | messagewhich port/process to send to
network layerdatagram -> src & dest ip | segmentwhich host to send to
link layerframe -> src & dest MAC | datagram | error checkwhich device to send to
ApplicationLayerTransportLayerNetworkLayerLinkLayermessagesegmentheadermessagedatagramheadersegmentframeheaderdatagramframetrailer

each successive layer builds upon the packet

Tables at each layer

DeviceLayerTable NameStoresPurpose
Host (OS / apps)ApplicationApplication state / session tableApp-specific data (sessions, requests, cookies)Track application-level interactions
Host (OS kernel)TransportSocket / connection table(IP, port, protocol) <-> processDeliver data to correct application
Router / HostNetworkRouting tableNetwork prefix -> next hopDecide where to send packets
NAT RouterNetworkNAT translation table(private IP, port) <-> (public IP, port)Map internal <-> external connections
Host / RouterLinkARP table (ARP cache)IP -> MAC addressResolve next-hop MAC address
SwitchLinkMAC (forwarding) tableMAC address -> interfaceForward frames within LAN

Concept

Protocols

  • format and order of messages exchanged
  • actions taken upon receiving/sending

Protocol layers

  • built upon layers of abstraction, upper layers do not need to deal with the physical connection directly
  • all communication still goes through the physical layer
    network_layers.png

Application layer

  • application to application
  • protocols used by internet applications running on hosts
  • HTTP, DNS, FTP, SMTP
ArchitectureDesc
client-server- server: listens and waits, provides a service
- client: initiates contact
peer to peer(P2P)- end hosts communicate directly
- scalable: new users add more capacity
- difficult to manage
hybrid- central server helps to link end hosts
Requirements
  • data integrity: file transfer requires lossless; streaming can tolerate data loss
  • timing: games need low latency
  • throughput: multimedia requires minimum amount of bandwidth to be effective
  • security: encryption, authentication

Transport layer

  • process to process
  • runs on the host itself
  • TCP. UDP
StakeholderRole
senderbreak message into segments
receiverreassemble segment into messages
routersinspect dest ip and route

ususally, routers are in the network layer

Network layer

  • host to host
  • routers - forwards packets between networks
  • best-effort and unreliable
    • no guarantees for:
      • successful datagram delivery
      • timing/order of delivery
      • bandwidth provided
    • pros:
      • simple mechanism - wide adoption
      • sufficient provisioning of bandwidth - good enough most of the time
      • distributed services - multiple providers
  • control plane(application layer protocols):
  • data plane:
  • communication between adjacent nodes only
  • switch - smart forwarding
  • implemented in network interface cards(NIC) in hardware, integrated closely with the physical layer
  • ARP