Download presentation
Presentation is loading. Please wait.
1
Introduction to Networks
CSEN 404 Introduction to Networks Amr El Mougy Ali Saudi ** Slides are attributed to J. F. Kurose
2
Link Layer Application Transport Network Data Link PHY
3
Link Layer: Introduction
Some terminology: hosts and routers are nodes communication channels that connect adjacent nodes along communication path are links wired links wireless links LANs layer-2 packet is a frame, encapsulates datagram data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
4
Link Layer Functions Framing Medium Access Control (MAC)
Reliable delivery Flow control Error detection and correction
5
IP Address vs. MAC Address
32-bit IP address: network-layer address used to get datagram to destination IP subnet MAC (or LAN or physical or Ethernet) address: function: get frame from one interface to another physically- connected interface (same network) 48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software settable Each network card (adapter) has a permanent unique MAC address (a.k.a hardware address, physical address, LAN address) represented in hexadecimal notation 5: DataLink Layer
6
IP Address vs. MAC Address
xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 223 191 056 008 xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 1C 22 F3 D1 42 A9 5: DataLink Layer
7
LAN Addresses and ARP Broadcast address = FF-FF-FF-FF-FF-FF LAN
Each adapter on LAN has unique LAN address 1A-2F-BB AD Broadcast address = FF-FF-FF-FF-FF-FF LAN (wired or wireless) = adapter 71-65-F7-2B-08-53 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 5: DataLink Layer
8
LAN Address (more) MAC address allocation administered by IEEE
manufacturer buys portion of MAC address space (to assure uniqueness) analogy: (a) MAC address: like Social Security Number, SIN (b) 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 5: DataLink Layer
9
MACs in Frame Starting at A, given IP datagram addressed to B:
look up net. address of B, find B on same net. as A link layer send datagram to B inside link-layer frame
10
ARP: Address Resolution Protocol
Each IP node (host, router) on LAN has ARP table ARP table: IP/MAC address mappings for some LAN nodes < IP address; MAC address; TTL> TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) 1A-2F-BB AD LAN 71-65-F7-2B-08-53 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98
11
ARP protocol: Same LAN (network)
A wants to send datagram to B, and B’s MAC address not in A’s ARP table. A broadcasts ARP query packet, containing B's IP address dest MAC address = FF-FF-FF-FF-FF-FF all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC address frame sent to A’s MAC address (unicast) A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state: information that times out (goes away) unless refreshed ARP is “plug-and-play”: nodes create their ARP tables without intervention from net administrator
12
Addressing: routing to another LAN
walkthrough: send datagram from A to B via R assume A knows B’s IP address two ARP tables in router R, one for each IP network (LAN) 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D A C-E8-FF-55 88-B2-2F-54-1A-0F B 49-BD-D2-C7-56-2A LAN 5: DataLink Layer
13
R A B A creates IP datagram with source A, destination B
A uses ARP to get R’s MAC address for A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram A’s NIC sends frame R’s NIC receives frame R removes IP datagram from Ethernet frame, sees its destined to B R uses ARP to get B’s MAC address R creates frame containing A-to-B IP datagram sends to B R 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D A C-E8-FF-55 88-B2-2F-54-1A-0F B 49-BD-D2-C7-56-2A 5: DataLink Layer
14
Switches and Routers Routers Switches Traffic Isolation Yes Plug and Play No Optimal Routing Larger networks require routers as they have better traffic isolation and can find better routes
15
A Day in the Life of a Webpage Request
DNS Server GUC /24 Bob 00:16:D3:23:63:8A ISP /13 00:22:6B:45:1F:1B Bob wishes to retrieve a page from Bob has just booted up the computer Google /19
16
A Day in the Life of a Webpage Request
68 67 00:16:D3:23:63:8A FF:FF:FF:FF:FF:FF DNS Server GUC /24 Bob 00:16:D3:23:63:8A ISP /13 00:22:6B:45:1F:1B Yiaddr: 67 68 00:22:6B:45:1F:1B FF:FF:FF:FF:FF:FF DHCP ACK also includes IP of default gateway (router in this case) and DNS server Google /19
17
A Day in the Life of a Webpage Request
ARP Query 00:16:D3:23:63:8A FF:FF:FF:FF:FF:FF DNS Server GUC /24 Bob 00:16:D3:23:63:8A ISP /13 00:22:6B:45:1F:1B ARP Reply 00:22:6B:45:1F:1B 00:16:D3:23:63:8A Before sending a DNS query, Bob must first discover the MAC address of the router through ARP Google /19
18
A Day in the Life of a Webpage Request
DNS query: 61334 53 00:16:D3:23:63:8A 00:22:6B:45:1F:1B DNS reply: 53 61334 MAC of DNS MAC of default R DNS Server GUC /24 Bob 00:16:D3:23:63:8A ISP /13 00:22:6B:45:1F:1B To send HTTP request, Bob’s browser has to create a TCP socket. Thus, it needs the IP address of Google /19
19
A Day in the Life of a Webpage Request
52122 80 00:16:D3:23:63:8A 00:22:6B:45:1F:1B DNS Server GUC /24 Bob 00:16:D3:23:63:8A ISP /13 00:22:6B:45:1F:1B To establish TCP connection, TCP SYN packet is sent Google /19 80 52122 MAC of web server MAC of default R
20
A Day in the Life of a Webpage Request
HTTP Request: google search 52122 80 00:16:D3:23:63:8A 00:22:6B:45:1F:1B DNS Server GUC /24 Bob 00:16:D3:23:63:8A ISP /13 00:22:6B:45:1F:1B Finally HTTP request can be sent HTTP Reply: search results 80 52122 MAC of web server MAC of default R Google /19
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.