Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Architecture and Protocols IT443 – Network Security Administration Instructor: Bo Sheng 1 Reference Textbooks Computer Networks: A Systems Approach.

Similar presentations


Presentation on theme: "Network Architecture and Protocols IT443 – Network Security Administration Instructor: Bo Sheng 1 Reference Textbooks Computer Networks: A Systems Approach."— Presentation transcript:

1 Network Architecture and Protocols IT443 – Network Security Administration Instructor: Bo Sheng 1 Reference Textbooks Computer Networks: A Systems Approach Computer Networking: A Top Down Approach

2 Outline Network Layers Internet Protocol (IP) TCP and UDP 2

3 Layering: A Modular Approach Sub-divide the problem –Each layer relies on services from layer below –Each layer exports services to layer above Interface between layers defines interaction –Hides implementation details –Layers can change without disturbing other layers 3 Link Network Transport Application Physical HTTP, FTP, TELNET POP/IMAP, SSH, SSL, … TCP, UDP IP(IPv4, IPv6) Ethernet, DSL WiFi, …

4 Layer Encapsulation 4 4 Get index.html Connection ID Source/Destination Link Address User AUser B

5 IP Layer Data traffic divided into packets –Each packet contains a header (with address) Packets travel separately through network –Packet forwarding based on the header –Network nodes may store packets temporarily Destination reconstructs the message 5

6 IP Layer Packet Switching –VS. Circuit Switching Best-effort delivery –Packets may be lost –Packets may be corrupted –Packets may be delivered out of order 6

7 What if the Data Doesn’t Fit? 7 Problem: Packet size Solution: Split the data across multiple packets On Ethernet, max IP packet is 1500 bytes (MTU) Typical Web page is 10 kbytes GETindex.html GET index.html

8 What if the Data is Out of Order? 8 Solution: Add Sequence Numbers Problem: Out of Order GETx.htindeml GET x.htindeml GET index.html ml4inde2x.ht3GET1

9 IP Packet 9 20-byteheader 4-bit Version 4-bit Header Length 8-bit Type of Service (TOS) 16-bit Total Length (Bytes) 16-bit Identification 3-bit Flags 13-bit Fragment Offset 8-bit Time to Live (TTL) 8-bit Protocol 16-bit Header Checksum 32-bit Source IP Address 32-bit Destination IP Address Options (if any) Payload

10 Transport Protocols Provide logical communication between application processes running on different hosts Datagram messaging service (UDP) –No-frills extension of “best-effort” IP Reliable, in-order delivery (TCP) 10

11 Using Ports to Identify Services Web server (port 80) Client host Server host Echo server (port 7) Service request for :80 (i.e., the Web server) Web server (port 80) Echo server (port 7) Service request for :7 (i.e., the echo server) OS Client 11

12 Knowing What Port Number To Use Popular applications have well-known ports –E.g., port 80 for Web and port 25 for –Well-known ports listed at Well-known vs. ephemeral ports –Server has a well-known port (e.g., port 80) Between 0 and 1023 –Client picks an unused ephemeral (i.e., temporary) port Between 1024 and Uniquely identifying the traffic between the hosts –Two IP addresses and two port numbers –Underlying transport protocol (e.g., TCP or UDP)

13 Unreliable Message Delivery Service User Datagram Protocol (UDP) –IP plus port numbers –Optional error checking on the packet contents Lightweight communication between processes –Avoid overhead and delays of ordered, reliable delivery For example: VoIP, video conferencing, gaming 13 SRC port DST port checksumlength DATA

14 Transmission Control Protocol Communication service (socket) –Ordered, reliable byte stream –Simultaneous transmission in both directions Key mechanisms at end hosts –Retransmit lost and corrupted packets –Discard duplicate packets and put packets in order –Flow control to avoid overloading the receiver buffer –Congestion control to adapt sending rate to network load 14

15 An Analogy: Talking on a Cell Phone Alice and Bob on their cell phones –Both Alice and Bob are talking What if Alice couldn’t understand Bob? –Bob asks Alice to repeat what she said What if Bob hasn’t heard Alice for a while? –Is Alice just being quiet? –Or, have Bob and Alice lost reception? –How long should Bob just keep on talking? –Maybe Alice should periodically say “uh huh” –… or Bob should ask “Can you hear me now?” Retransmission, ACK/NACK, timeout 15

16 TCP Support for Reliable Delivery Checksum – Used to detect corrupted data at the receiver – …leading the receiver to drop the packet Sequence numbers – Used to detect missing data –... and for putting the data back in order Retransmission – Sender retransmits lost or corrupted data – Timeout based on estimates of round-trip time 16

17 Establishing a TCP Connection Three-way handshake to establish connection –Host A sends a SYN (open) to the host B –Host B returns a SYN acknowledgment (SYN ACK) –Host A sends an ACK to acknowledge the SYN ACK 17 SYN SYN ACK ACK Data Each host tells its ISN to the other host.

18 TCP Header 18 Source portDestination port Sequence number Acknowledgment Advertised window HdrLen Flags 0 ChecksumUrgent pointer Options (variable) Data Flags: SYN FIN RST PSH URG ACK

19 Identifiers Transport Layer: port number IP Layer: IP address Link Layer: MAC address 19

20 IP Suite: End Hosts vs. Routers 20 HTTP TCP IP Ethernet interface HTTP TCP IP Ethernet interface IP Ethernet interface Ethernet interface SONET interface SONET interface host router HTTP message TCP segment IP packet

21 Outline Addressing and Naming –IP prefix, DNS, ARP 21

22 Grouping Related Hosts The Internet is an “inter-network” –Used to connect networks together, not hosts –Needs a way to address a network (i.e., group of hosts) 22 host LAN 1... host LAN 2... router WAN LAN = Local Area Network WAN = Wide Area Network

23 Scalability Challenge Suppose hosts had arbitrary addresses –Then every router would need a lot of information –…to know how to direct packets toward the host 23 host LAN 1... host LAN 2... router WAN forwarding table

24 IP Prefix Divided into network & host portions (left and right) /24 is a 24-bit prefix with 2 8 addresses Network (24 bits)Host (8 bits)

25 IP Address and Subnet Mask Address Mask

26 Scalability Improved Number related hosts from a common subnet – /24 on the left LAN – /24 on the right LAN 26 host LAN 1... host LAN 2... router WAN / /24 forwarding table

27 Easy to Add New Hosts No need to update the routers –E.g., adding a new host on the right –Doesn’t require adding a new forwarding entry 27 host LAN 1... host LAN 2... router WAN / /24 forwarding table host

28 Classful Addressing In the olden days, only fixed allocation sizes –Class A: Very large /8 blocks (e.g., MIT has /8) –Class B: Large /16 blocks (e.g,. Princeton has /16) –Class C: Small /24 blocks (e.g., AT&T Labs has /24) 28

29 Classless Inter-Domain Routing (CIDR) 29 IP Address : IP Mask: Mask for hostsNetwork Prefix Use two 32-bit numbers to represent a network. Network number = IP address + Mask Written as /15

30 Private Networks Not globally delegated – /8 ( ) – /12 ( ) – /16 ( ) 30

31 Growth History BGP (Broader Gateway Protocol) Table Size –Autonomous systems (routing prefixes) –http://bgp.potaroo.net/as1221/bgp-active.html 31

32 Are 32-bit Addresses Enough? Not all that many unique addresses –2 32 = 4,294,967,296 (just over four billion) –Plus, some are reserved for special purposes –And, addresses are allocated in larger blocks And, many devices need IP addresses –Computers, PDAs, routers, smartphones, toasters, … Long-term solution: a larger address space –IPv6 has 128-bit addresses (2 128 = × ) Short-term solutions: limping along with IPv4 –Private addresses –Network address translation (NAT) –Dynamically-assigned addresses (DHCP) 32

33 Naming: Domain Name System (DNS) Properties of DNS –Hierarchical name space divided into zones –Translation of names to/from IP addresses –Distributed over a collection of DNS servers 33

34 13 root servers (see Labeled A through M DNS Root Servers 34 B USC-ISI Marina del Rey, CA L ICANN Los Angeles, CA E NASA Mt View, CA F Internet Software C. Palo Alto, CA (and 17 other locations) I Autonomica, Stockholm (plus 3 other locations) m WIDE Tokyo A Verisign, Dulles, VA C Cogent, Herndon, VA (also Los Angeles) D U Maryland College Park, MD G US DoD Vienna, VA H ARL Aberdeen, MD J Verisign, ( 11 locations) K RIPE London (also Amsterdam, Frankfurt)

35 Domain Name System 35 comeduorgac uk zw arpa unnamed root bar westeast foomy ac cam usr in- addr generic domainscountry domains my.east.bar.edu usr.cam.ac.uk /24

36 DNS Resolver and Local DNS Server 36 Application DNS resolver Local DNS server 1 10 DNS cache DNS query 2 DNS response 9 Root server 3 4 Top-level domain server 5 6 Second-level domain server 7 8 Caching based on a time-to-live (TTL) assigned by the DNS server responsible for the host name to reduce latency in DNS translation.

37 Recursive and Iterative Recursive query –Ask server to get answer for you –E.g., request 2 and response 9 Iterative query –Ask server who to ask next –E.g., all other request-response pairs 37

38 DNS Caching Performing all these queries take time –And all this before the actual communication takes place –E.g., 1-second latency before starting Web download Caching can substantially reduce overhead –The top-level servers very rarely change –Popular sites (e.g., visited often –Local DNS server often has the information cached How DNS caching works –DNS servers cache responses to queries –Responses include a “time to live” (TTL) field –Server deletes the cached entry after TTL expires 38

39 Negative Caching Remember things that don’t work –Misspellings like and –These can take a long time to fail the first time –Good to remember that they don’t work –… so the failure takes less time the next time around 39

40 Address Translation 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 Analogy: –MAC address: like Social Security Number –IP address: like postal address 40

41 ARP: Address Resolution Protocol Each IP node (host, router) on LAN has ARP table ARP table: IP/MAC address mappings for some LAN nodes –TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) First time (A→B): A broadcasts an ARP query packet, containing B's IP address –destination MAC address = FF-FF-FF-FF-FF-FF –all machines on LAN receive ARP query 41

42 Addressing: routing to another LAN walkthrough: send datagram from A to B via R. –focus on addressing - at both IP (datagram) and MAC layer (frame) Data Link Layer 5-42 R 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D C-E8-FF-55 A BD-D2-C7-56-2A B2-2F-54-1A-0F B

43 Data Link Layer 5-43 R 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D C-E8-FF-55 A IP Eth Phy IP src: IP dest:  A creates IP datagram with IP source A, destination B  A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram MAC src: C-E8-FF-55 MAC dest: E6-E BB-4B BD-D2-C7-56-2A B2-2F-54-1A-0F B

44 Data Link Layer 5-44 R 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D C-E8-FF-55 A IP Eth Phy  frame sent from A to R IP src: IP dest: MAC src: C-E8-FF-55 MAC dest: E6-E BB-4B IP Eth Phy  frame received at R, datagram removed, passed up to IP BD-D2-C7-56-2A B2-2F-54-1A-0F B

45 Data Link Layer 5-45 R 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D C-E8-FF BD-D2-C7-56-2A B2-2F-54-1A-0F B A IP src: IP dest:  R forwards datagram with IP source A, destination B  R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy IP Eth Phy

46 Data Link Layer 5-46 R 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D C-E8-FF BD-D2-C7-56-2A B2-2F-54-1A-0F B A  R forwards datagram with IP source A, destination B  R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram IP src: IP dest: MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy IP Eth Phy

47 Data Link Layer 5-47 R 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D C-E8-FF BD-D2-C7-56-2A B2-2F-54-1A-0F B A  R forwards datagram with IP source A, destination B  R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram IP src: IP dest: MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy


Download ppt "Network Architecture and Protocols IT443 – Network Security Administration Instructor: Bo Sheng 1 Reference Textbooks Computer Networks: A Systems Approach."

Similar presentations


Ads by Google