300 likes | 586 Views
شبکه های کامپیوتری پیشرفته. مطالب درس. مروری بر شبکه های کامپیوتری و اینترنت شبکه های گسترده ( WAN ) ATM MPLS شبکه های بی سیم انتقال بی سیم شبکه های بی سیم شبکه های MANET, WSN, WMN شبکه های چندرسانه ای ( Multimedia ) شبکه های نظیر به نظیر ( Peer-to-Peer ). PC. Mobile network. server.
E N D
مطالب درس • مروری بر شبکه های کامپیوتری و اینترنت • شبکه های گسترده (WAN) • ATM • MPLS • شبکه های بی سیم • انتقال بی سیم • شبکه های بی سیم • شبکه های MANET, WSN, WMN • شبکه های چندرسانه ای (Multimedia) • شبکه های نظیر به نظیر (Peer-to-Peer)
PC Mobile network server Global ISP wireless laptop cellular handheld Home network Regional ISP access points wired links Institutional network router مروری بر شبکه های کامپیوتری و اینترنت • millions of connected computing devices: hosts = end systems • running network apps • communication links • fiber, copper, radio, satellite • transmission rate = bandwidth • routers: forward packets (chunks of data)
A closer look at network structure: • network edge: applications and hosts • access networks, physical media: wired, wireless communication links • network core: • interconnected routers • network of networks
peer-peer client/server The network edge: • end systems (hosts): • run application programs • e.g. Web, email • at “edge of network” • client/server model • client host requests, receives service from always-on server • e.g. Web browser/server; email client/server • peer-peer model: • minimal (or no) use of dedicated servers • e.g. Skype, BitTorrent
Access networks and physical media Q: How to connect end systems to edge router? • residential access nets • institutional access networks (school, company): LAN • mobile access networks Keep in mind: • bandwidth (bits per second) of access network? • shared or dedicated?
Local area networks • company/univlocal area network (LAN) connects end system to edge router • Ethernet: • 10 Mbs, 100Mbps, 1Gbps, 10Gbps Ethernet • modern configuration: end systems connect into Ethernetswitch
Wireless access networks • shared wireless access network connects end system to router • via base station aka “access point” • wireless LANs: • 802.11b/g (WiFi): 11 or 54 Mbps • wider-area wireless access • provided by operators • ~1Mbps over cellular system • WiMAX (10’s Mbps) over wide area router base station mobile hosts
The Network Core • mesh of interconnected routers • the fundamental question: how is data transferred through net? • circuit switching: dedicated circuit per call: telephone net • packet-switching: data sent thru net in discrete “chunks”
Internet protocol stack • application: supporting network applications (FTP, SMTP, HTTP) • transport: process-process data transfer (TCP, UDP) • network: routing of datagrams from source to destination • IP, routing protocols • link: data transfer between neighboring network elements • PPP, Ethernet • physical: bits “on the wire”
network link physical link physical M M M Ht M Hn Hn Hn Hn Ht Ht Ht Ht M M M M Ht Hn Ht Hl Hl Hl Hn Hn Hn Ht Ht Ht M M M source Encapsulation message application transport network link physical segment datagram frame switch destination application transport network link physical router
error control (detection & recovery) • EDC= Error Detection and Correction bits (redundancy) • D = Data protected by error checking, may include header fields • Error detection not 100% reliable! • protocol may miss some errors, but rarely • larger EDC field yields better detection and correction • ARQ: automatic request repeat • Stop and Wait • Sliding Window
Two Key Network-Layer Functions • forwarding: move packets from router’s input to appropriate router output • routing: determine route taken by packets from source to dest. • routing algorithms
routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 1 0111 2 3 Interplay between routing and forwarding
A D E B F C Routing protocol Routing 5 Goal: determine “good” path (sequence of routers) thru network from source to dest. Graph abstraction for routing algorithms: • graph nodes are routers • graph edges are physical links • link cost: delay, $ cost, or congestion level 3 5 2 2 1 3 1 2 1 • “good” path: • typically means minimum cost path • other def’s possible
Routing: only two approaches used in practice Global: • all routers have complete topology, link cost info • “link state” algorithms: use Dijkstra’s algorithm to find shortest path from given router to all destinations Decentralized: • router knows physically-connected neighbors, link costs to neighbors • iterative process of computation, exchange of info with neighbors • “distance vector” algorithms • a ‘self-stabilizing algorithm’ (we’ll see these later)
223.1.1.2 223.1.2.1 223.1.3.27 223.1.3.1 223.1.3.2 223.1.2.2 Addressing: network layer 223.1.1.1 • IP address: 32-bit identifier for host, router interface • interface: connection between host, router and physical link • router’s typically have multiple interfaces • host may have multiple interfaces • IP addresses associated with interface, not host, router 223.1.2.9 223.1.1.4 223.1.1.3 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1
IP Addressing 223.1.1.1 223.1.2.1 223.1.1.2 • IP address: • network part (high order bits) • host part (low order bits) • what’s a network ? (from IP address perspective) • device interfaces with same network part of IP address • can physically reach each other without intervening router 223.1.2.9 223.1.1.4 223.1.2.2 223.1.3.27 223.1.1.3 LAN 223.1.3.2 223.1.3.1 network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address)
shared RF (e.g., 802.11 WiFi) switch star LANs • bus topology popular through mid 90s • today: star topology prevails • active switch in center, each “spoke” runs a (separate) Ethernet protocol • wireless LANS: 802.11 bus: coaxial cable
LAN Addresses Each adapter on LAN has unique LAN address (also has an IP address) • LAN (or MAC or physical) address: • used to get datagram from one interface to another physically-connected interface (same network) • 48 bit MAC address (for most LANs) burned in the adapter ROM Question: why separate MAC and IP addresses?
Question: how to determine MAC address of B knowing B’s IP address? 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) 137.196.7.78 1A-2F-BB-76-09-AD 137.196.7.23 137.196.7.14 LAN 71-65-F7-2B-08-53 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 137.196.7.88
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
88-B2-2F-54-1A-0F 74-29-9C-E8-FF-55 E6-E9-00-17-BB-4B 222.222.222.221 1A-23-F9-CD-06-9B 111.111.111.111 222.222.222.222 222.222.222.220 111.111.111.110 R 111.111.111.112 49-BD-D2-C7-56-2A CC-49-DE-D0-AB-7D B A 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)
88-B2-2F-54-1A-0F 74-29-9C-E8-FF-55 E6-E9-00-17-BB-4B 222.222.222.221 1A-23-F9-CD-06-9B 111.111.111.111 222.222.222.222 222.222.222.220 B A 111.111.111.110 R 111.111.111.112 49-BD-D2-C7-56-2A CC-49-DE-D0-AB-7D This is a really important example – make sure you understand! • A creates IP datagram with source A, destination B • A uses ARP to get R’s MAC address for 111.111.111.110 • 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