Advance Computer Networks Lecture#10 Instructor: Engr. Muhammad Mateen Yaqoob
Mateen Yaqoob Department of Computer Science MAC addresses and ARP 32-bit IP address: network-layer address for interface used for layer 3 (network layer) forwarding MAC (or LAN or physical or Ethernet) address: function: used ‘locally” to get frame from one interface to another physically-connected interface (same network, in IP- addressing sense) 48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software settable e.g.: 1A-2F-BB AD hexadecimal (base 16) notation (each “number” represents 4 bits)
Mateen Yaqoob Department of Computer Science LAN addresses and ARP each adapter on LAN has unique LAN address adapter 1A-2F-BB AD D7-FA-20-B0 0C-C4-11-6F-E F7-2B LAN (wired or wireless)
Mateen Yaqoob Department of Computer Science LAN addresses (more) MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure uniqueness) analogy: MAC address: like Social Security Number IP address: like postal address MAC flat address ➜ portability can move LAN card from one LAN to another IP hierarchical address not portable address depends on IP subnet to which node is attached
Mateen Yaqoob Department of Computer Science ARP: address resolution protocol ARP table: each IP node (host, router) on LAN has table IP/MAC address mappings for some LAN nodes: TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) Question: how to determine interface’s MAC address, knowing its IP address? 1A-2F-BB AD D7-FA-20-B0 0C-C4-11-6F-E F7-2B LAN
Mateen Yaqoob Department of Computer Science Switches vs. routers both are store-and-forward: routers: network-layer devices (examine network- layer headers) switches: link-layer devices (examine link-layer headers) both have forwarding tables: routers: compute tables using routing algorithms, IP addresses switches: learn forwarding table using flooding, learning, MAC addresses application transport network link physical network link physical link physical switch datagram application transport network link physical frame datagram
Mateen Yaqoob Department of Computer Science VLANs: motivation consider: CS user moves office to EE, but wants connect to CS switch? single broadcast domain: all layer-2 broadcast traffic (ARP, DHCP, unknown location of destination MAC address) must cross entire LAN security/privacy, efficiency issues Computer Science Electrical Engineering Computer Engineering
Mateen Yaqoob Department of Computer Science VLANs port-based VLAN: switch ports grouped (by switch management software) so that single physical switch …… switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure. Virtual Local Area Network … Electrical Engineering (VLAN ports 1-8) Computer Science (VLAN ports 9-15) 15 … Electrical Engineering (VLAN ports 1-8) … … Computer Science (VLAN ports 9-16) … operates as multiple virtual switches
Multiprotocol label switching (MPLS) IETF (Internet Engineering Task Force) approved a standard = MPLS Conventional routers in the Internet can be replaced by MPLS routers MPLS Router: It can work like a switch and a router When behaving like a router; it can forward the packets based on destination address When behaving like a switch; it can forward a packet based on label Mateen Yaqoob Department of Computer Science
Multiprotocol label switching (MPLS) initial goal: high-speed IP forwarding using fixed length label (instead of IP address) fast lookup using fixed length identifier (rather than shortest prefix matching) borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address! PPP or Ethernet header IP header remainder of link-layer frame MPLS header label Exp S TTL Label: 20-bit; label used to index forwarding table in router Exp: 3-bit; reserved for experimental purposes S: 1-bit; situation of sub-header in stack. When bit is 1, it means the header is last one in stack TTL: 8-bit; similar to TTL in IP datagram
Mateen Yaqoob Department of Computer Science MPLS capable routers a.k.a. label-switched router forward packets to outgoing interface based only on label value (don’t inspect IP address) MPLS forwarding table distinct from IP forwarding tables flexibility: MPLS forwarding decisions can differ from those of IP use destination and source addresses to route flows to same destination differently (traffic engineering) re-route flows quickly if link fails: pre-computed backup paths (useful for VoIP)
Data center networks 10’s to 100’s of thousands of hosts, often closely coupled, in close proximity: e-business (e.g. Amazon) content-servers (e.g., YouTube, Akamai, Apple, Microsoft) search engines, data mining (e.g., Google) Mateen Yaqoob Department of Computer Science challenges: multiple applications, each serving massive numbers of clients managing/balancing load, avoiding processing, networking, data bottlenecks Inside a 40-ft Microsoft container, Chicago data center
Mateen Yaqoob Department of Computer Science Server racks TOR switches Tier-1 switches Tier-2 switches Load balancer Load balancer B A C Border router Access router Internet Data center networks load balancer: application-layer routing receives external client requests directs workload within data center returns results to external client (hiding data center internals from client)
Server racks TOR switches Tier-1 switches Tier-2 switches Data center networks rich interconnection among switches, racks: increased throughput between racks (multiple routing paths possible) increased reliability via redundancy Mateen Yaqoob Department of Computer Science
Synthesis: a day in the life of a web request journey down protocol stack complete! application, transport, network, link putting-it-all-together: synthesis! goal: identify, review, understand protocols (at all layers) involved in seemingly simple scenario: requesting www page scenario: student attaches laptop to campus network, requests/receives Mateen Yaqoob Department of Computer Science
A day in the life: scenario /13 Google’s network / web server DNS server school network /24 web page browser
router (runs DHCP) Mateen Yaqoob Department of Computer Science A day in the life… connecting to the Internet connecting laptop needs to get its own IP address, addr of first-hop router, addr of DNS server: use DHCP DHCP UDP IP Eth Phy DHCP UDP IP Eth Phy DHCP DHCP request encapsulated in UDP, encapsulated in IP, encapsulated in Ethernet Ethernet frame broadcast (dest: FFFFFFFFFFFF) on LAN, received at router running DHCP server Ethernet demuxed to IP demuxed, UDP demuxed to DHCP
router (runs DHCP) Mateen Yaqoob Department of Computer Science DHCP server formulates DHCP ACK containing client’s IP address, IP address of first- hop router for client, name & IP address of DNS server DHCP UDP IP Eth Phy DHCP UDP IP Eth Phy DHCP encapsulation at DHCP server, frame forwarded (switch learning) through LAN, demultiplexing at client Client now has IP address, knows name & addr of DNS server, IP address of its first-hop router DHCP client receives DHCP ACK reply A day in the life… connecting to the Internet
router (runs DHCP) Mateen Yaqoob Department of Computer Science A day in the life… ARP (before DNS, before HTTP) before sending HTTP request, need IP address of DNS DNS UDP IP Eth Phy DNS DNS query created, encapsulated in UDP, encapsulated in IP, encapsulated in Eth. To send frame to router, need MAC address of router interface: ARP ARP query broadcast, received by router, which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router, so can now send frame containing DNS query ARP query Eth Phy ARP ARP reply
router (runs DHCP) Mateen Yaqoob Department of Computer Science DNS UDP IP Eth Phy DNS IP datagram containing DNS query forwarded via LAN switch from client to 1 st hop router IP datagram forwarded from campus network into comcast network, routed (tables created by RIP, OSPF, IS-IS and/or BGP routing protocols) to DNS server demux’ed to DNS server DNS server replies to client with IP address of Comcast network /13 DNS server DNS UDP IP Eth Phy DNS A day in the life… using DNS
router (runs DHCP) Mateen Yaqoob Department of Computer Science A day in the life…TCP connection carrying HTTP HTTP TCP IP Eth Phy HTTP to send HTTP request, client first opens TCP socket to web server TCP SYN segment (step 1 in 3- way handshake) inter-domain routed to web server TCP connection established! web server SYN TCP IP Eth Phy SYN SYNACK web server responds with TCP SYNACK (step 2 in 3-way handshake)
router (runs DHCP) Mateen Yaqoob Department of Computer Science A day in the life… HTTP request/reply HTTP TCP IP Eth Phy HTTP HTTP request sent into TCP socket IP datagram containing HTTP request routed to IP datagram containing HTTP reply routed back to client web server HTTP TCP IP Eth Phy web server responds with HTTP reply (containing web page) HTTP web page finally (!!!) displayed
Wireless and Mobile Networks Background: # wireless (mobile) phone subscribers now exceeds # wired phone subscribers (5-to-1)! # wireless Internet-connected devices equals # wireline Internet-connected devices laptops, Internet-enabled phones promise anytime untethered Internet access two important (but different) challenges wireless: communication over wireless link mobility: handling the mobile user who changes point of attachment to network Mateen Yaqoob Department of Computer Science
wireless hosts laptop, smartphone run applications may be stationary (non- mobile) or mobile wireless does not always mean mobility Elements of a wireless network network infrastructure
Mateen Yaqoob Department of Computer Science base station typically connected to wired network relay - responsible for sending packets between wired network and wireless host(s) in its “area” e.g., cell towers, access points Elements of a wireless network network infrastructure
Mateen Yaqoob Department of Computer Science wireless link typically used to connect mobile(s) to base station also used as backbone link multiple access protocol coordinates link access various data rates, transmission distance Elements of a wireless network network infrastructure
Mateen Yaqoob Department of Computer Science Characteristics of selected wireless links Indoor 10-30m Outdoor m Mid-range outdoor 200m – 4 Km Long-range outdoor 5Km – 20 Km G: IS-95, CDMA, GSM 2.5G: UMTS/WCDMA, CDMA b a,g 3G: UMTS/WCDMA-HSPDA, CDMA2000-1xEVDO 4G: LTWE WIMAX a,g point-to-point n Data rate (Mbps)
Mateen Yaqoob Department of Computer Science infrastructure mode base station connects mobiles into wired network handoff: mobile changes base station providing connection into wired network Elements of a wireless network network infrastructure
Mateen Yaqoob Department of Computer Science ad hoc mode no base stations nodes can only transmit to other nodes within link coverage nodes organize themselves into a network: route among themselves Elements of a wireless network
Mateen Yaqoob Department of Computer Science Wireless network taxonomy single hop multiple hops infrastructure (e.g., APs) no infrastructure host connects to base station (WiFi, WiMAX, cellular) which connects to larger Internet no base station, no connection to larger Internet (Bluetooth, ad hoc nets) host may have to relay through several wireless nodes to connect to larger Internet: mesh net no base station, no connection to larger Internet. May have to relay to reach other a given wireless node MANET, VANET
Wireless Link Characteristics important differences from wired link …. decreased signal strength: radio signal attenuates as it propagates through matter (path loss) interference from other sources: standardized wireless network frequencies (e.g., 2.4 GHz) shared by other devices (e.g., phone); devices (motors) interfere as well multipath propagation: radio signal reflects off objects ground, arriving ad destination at slightly different times …. make communication across (even a point to point) wireless link much more “difficult” Mateen Yaqoob Department of Computer Science
Wireless Link Characteristics SNR: signal-to-noise ratio larger SNR – easier to extract signal from noise (a “good thing”) SNR versus BER tradeoffs given physical layer: increase power -> increase SNR->decrease BER given SNR: choose physical layer that meets BER requirement, giving highest thruput SNR may change with mobility: dynamically adapt physical layer (modulation technique, rate) Mateen Yaqoob Department of Computer Science QAM256 (8 Mbps) QAM16 (4 Mbps) BPSK (1 Mbps) SNR(dB) BER
IEEE Wireless LAN b GHz unlicensed spectrum up to 11 Mbps direct sequence spread spectrum (DSSS) in physical layer all hosts use same chipping code a 5-6 GHz range up to 54 Mbps g GHz range up to 54 Mbps n: multiple antennae GHz range up to 200 Mbps Mateen Yaqoob Department of Computer Science all use CSMA/CA for multiple access all have base-station and ad-hoc network versions
Mateen Yaqoob Department of Computer Science LAN architecture wireless host communicates with base station base station = access point (AP) Basic Service Set (BSS) (aka “cell”) in infrastructure mode contains: wireless hosts access point (AP): base station ad hoc mode: hosts only BSS 1 BSS 2 Internet hub, switch or router
Mateen Yaqoob Department of Computer Science : Channels, association b: 2.4GHz-2.485GHz spectrum divided into 11 channels at different frequencies AP admin chooses frequency for AP interference possible: channel can be same as that chosen by neighboring AP! host: must associate with an AP scans channels, listening for beacon frames containing AP’s name (SSID) and MAC address selects AP to associate with may perform authentication [Chapter 8] will typically run DHCP to get IP address in AP’s subnet
Mateen Yaqoob Department of Computer Science : passive/active scanning AP 2 AP 1 H1 BBS 2 BBS passive scanning: (1)beacon frames sent from APs (2)association Request frame sent: H1 to selected AP (3)association Response frame sent from selected AP to H1 AP 2 AP 1 H1 BBS 2 BBS active scanning: (1)Probe Request frame broadcast from H1 (2)Probe Response frames sent from APs (3)Association Request frame sent: H1 to selected AP (4)Association Response frame sent from selected AP to H1
IEEE : multiple access avoid collisions: 2 + nodes transmitting at same time : CSMA - sense before transmitting don’t collide with ongoing transmission by other node : no collision detection! difficult to receive (sense collisions) when transmitting due to weak received signals (fading) can’t sense all collisions in any case: hidden terminal, fading goal: avoid collisions: CSMA/C(ollision)A(voidance) Mateen Yaqoob Department of Computer Science space A B C A B C A’s signal strength C’s signal strength
IEEE MAC Protocol: CSMA/CA sender 1 if sense channel idle for DIFS then transmit entire frame (no CD) 2 if sense channel busy then start random back off time timer counts down while channel idle transmit when timer expires if no ACK, increase random back off interval, repeat receiver - if frame received OK return ACK after SIFS (ACK needed due to hidden terminal problem) Mateen Yaqoob Department of Computer Science sender receiver DIFS data SIFS ACK
Avoiding collisions (more) idea: allow sender to “reserve” channel rather than random access of data frames: avoid collisions of long data frames sender first transmits small request-to-send (RTS) packets to BS using CSMA RTSs may still collide with each other (but they’re short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes sender transmits data frame other stations defer transmissions Mateen Yaqoob Department of Computer Science avoid data frame collisions completely using small reservation packets!
Mateen Yaqoob Department of Computer Science Collision Avoidance: RTS-CTS exchange AP A B time RTS(A) RTS(B) RTS(A) CTS(A) DATA (A) ACK(A) reservation collision defer
Mateen Yaqoob Department of Computer Science : advanced capabilities Rate adaptation base station, mobile dynamically change transmission rate (physical layer modulation technique) as mobile moves, SNR varies QAM256 (8 Mbps) QAM16 (4 Mbps) BPSK (1 Mbps) SNR(dB) BER operating point 1. SNR decreases, BER increase as node moves away from base station 2. When BER becomes too high, switch to lower transmission rate but with lower BER
Mateen Yaqoob Department of Computer Science power management node-to-AP: “I am going to sleep until next beacon frame” AP knows not to transmit frames to this node node wakes up before next beacon frame beacon frame: contains list of mobiles with AP-to-mobile frames waiting to be sent node will stay awake if AP-to-mobile frames to be sent; otherwise sleep again until next beacon frame : advanced capabilities