Presentation is loading. Please wait.

Presentation is loading. Please wait.

Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE.

Similar presentations


Presentation on theme: "Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE."— Presentation transcript:

1 Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 10: Internetworking

2 Univ. of TehranIntroduction to Computer Network2 Outline Internetworking Best Effort Service Model Segmentation and Reassembly (SAR) Global Addressing Scheme Packet forwarding.

3 Univ. of TehranIntroduction to Computer Network3 Internetworking Communication between networks, either directly connected or switched Problems: Different Networking technologies (Heterogeneity). So many Networks (Scaling). Surviving in case of failure. Different services etc., Some terminologies: “internetworking” refer to an arbitrary collection of connected networks. “Internet” the global internetwork.

4 Univ. of TehranIntroduction to Computer Network4 Goals of the DARPA project 0 Connect existing networks initially ARPANET and ARPA packet radio network 1. Survivability - ensure communication service even in the presence of network and router failures 2. Support multiple types of services 3. Must accommodate a variety of networks 4. Allow distributed management 5. Allow host attachment with a low level of effort 6. Allow resource accountability

5 Univ. of TehranIntroduction to Computer Network5 IP Internet Concatenation of Networks or “networks of Networks”. “R” is routers and “H” is hosts. R2 R1 H4 H5 H3 H2 H1 Network 2 (Ethernet) Network 1 (Ethernet) H6 Network 4 (point-to-point) H7R3H8 Network 3 (FDDI)

6 Univ. of TehranIntroduction to Computer Network6 IP Internet (cont) Protocol Stack Everything is running on top of IP, “IP over everything” R1 ETH FDDI IP IP ETH TCP R2 FDDI PPP IP R3 PPP ETH IP H1 IP ETH TCP H8

7 Univ. of TehranIntroduction to Computer Network7 Service Model Connectionless (datagram-based) Best-effort delivery (unreliable service) packets are lost. No recover from lost. packets are delivered out of order duplicate copies of a packet are delivered packets can be delayed for a long time Datagram format Version HLen TOS Length IdentFlagsOffset TTL ProtocolChecksum SourceAddr DestinationAddr Options (variable) Pad (variable) 04 816 1931 Data Contains all information for routing of a packet.

8 Univ. of TehranIntroduction to Computer Network8 Packet Headers  The current Version is 4 or IPv4.  HLen- the Header Length: from 5-15 in 32-bit words.  Length- the total length of the packet including headers. Max length is 64K.  TTL: Time To Live is expressed in second. It is to prevent packet from permanently circulating in a loop.  Protocol: specify the packet application ex. 1 for ICMP. It is for demultiplexing to higher layer protocols.  Checksum: is a 1-complement error checksum for the header only.

9 Univ. of TehranIntroduction to Computer Network9 Packet Headers (Cont) TOS: type of Service Precedence Specify the priority Type of Services Specify routing, for instance cheapest, fastest and more reliable D for Delay T for Throughput R for Reliability C for low cost. Note: Precedence is only for inside channel queuing. 0 2 | 3 7 Precedence Type of service DTRC

10 Univ. of TehranIntroduction to Computer Network10 Packet Headers (Cont) Options If C set, the option will copied to all fragments. Otherwise, only to the first one. Class 0 for control Class 2 for debugging and measurement. Options are rarely used in today except for ‘loose’ and ‘strict’ source routing parameters. ‘loose’ and ‘strict’ source option sometimes, is used for IP encapsulation in another IP or “Tunneling” CClassNumber

11 Univ. of TehranIntroduction to Computer Network11 Fragmentation and Reassembly 0 7|0 7|0 4 7|0 7 IdentificationFlagsFragment Offset 012 0DFMF  Flags  DF: Don’t Fragment  MF: More Fragment coming In fragmentation, IP copy the original header and only modify The length, which is the new length, and offset. Offset is used for reassembly.  Note: Fragmentation may degrade the network performance. That is why the IP packet should be the same of TCP packets Modern TCP implement “Path MTU discovery”. It start with large packet and with DF set flag, if it passed TCP keeps the same packet size, otherwise, it reduces it.

12 Univ. of TehranIntroduction to Computer Network12 Fragmentation and Reassembly (cont) Each network has a Maximum Transfer Unit size, MTU Strategy fragment when necessary (MTU < Datagram) try to avoid fragmentation at source host re-fragmentation is possible fragments are self-contained datagrams use CS-PDU (not cells) for ATM delay reassembly until destination host do not recover from lost fragments

13 Univ. of TehranIntroduction to Computer Network13 Example Packet delivery from host H1 to host H8 H1R1R2R3H8 ETHIP(1400)FDDIIP(1400)PPPIP(512) PPPIP(376) PPPIP(512) ETHIP(512) ETHIP(376) ETHIP(512)

14 Univ. of TehranIntroduction to Computer Network14 Example (cont) Ident = xOffset = 0 Start of header 0 Rest of header 1400 data bytes Ident = xOffset = 0 Start of header 1 Rest of header 512 data bytes Ident = x Offset = 512 Start of header 1 Rest of header 512 data bytes Ident = xOffset = 1024 Start of header 0 Rest of header 376 data bytes The packets are fragmented as:

15 Univ. of TehranIntroduction to Computer Network15 Addressing Each host in the network is identified by an address having the following property. globally unique hierarchical: network + host Address Classes Class D for Multicasting Class E for experiments Address Notation 10.3.2.4 128.96.33.81 192.12.69.77 Network Host 724 0 A: Network Host 1416 10 B: Network Host 218 110 C:

16 Univ. of TehranIntroduction to Computer Network16 IP Addresses Example: Class “A” addresswww.mit.edu 18.181.0.31 (18 Class A) Class “B” addressmekong.stanford.edu 171.64.74.155 (128 Class C)www.ece.ut.ac.irwww.ece.ut.ac.ir 194.225.

17 Univ. of TehranIntroduction to Computer Network17 Addressing in IP IP addresses are names of interfaces Domain Name System (DNS) names are names of hosts DNS binds host names to interfaces Routing binds interface names to paths

18 Univ. of TehranIntroduction to Computer Network18 How to assign IP Addresses? Manually Uniqueness Too much and tedious job Dynamically: use DHCP: Dynamic Host Configuration Protocol.

19 Univ. of TehranIntroduction to Computer Network19 Making a Forwarding Decision Class AClass BClass CD 212.17.9.4 Class A Class B Class C 212.17.9.0Port 4 Exact Match Routing Table: IP Address Space 212.17.9.0

20 Univ. of TehranIntroduction to Computer Network20 Forwarding Datagrams Every datagram contains a destination address. “Network ID” uniquely identifies a physical network. All hosts and routers sharing a Network ID share same physical network.

21 Univ. of TehranIntroduction to Computer Network21 Forwarding an IP Router Lookup packet DA in forwarding table. –If known, forward to correct port. –If unknown, drop packet. Decrement TTL, update header Checksum. Forward packet to the outgoing interface. Transmit packet onto link.

22 Univ. of TehranIntroduction to Computer Network22 Address Translation Map IP addresses into physical addresses destination host next hop router Techniques encode physical address in host part of IP address table-based ARP table of IP to physical address bindings broadcast request if IP address not in table target machine responds with its physical address table entries are discarded if not refreshed

23 Univ. of TehranIntroduction to Computer Network23 ARP Details Request Format HardwareType: type of physical network (e.g., Ethernet) ProtocolType: type of higher layer protocol (e.g., IP) HLEN & PLEN: length of physical and protocol addresses Operation: request or response Source/Target-Physical/Protocol addresses Notes table entries timeout in about 10 minutes update table with source when you are the target update table if already have an entry do not refresh table entries upon reference

24 Univ. of TehranIntroduction to Computer Network24 ARP Packet Format TargetHardwareAddr (bytes 2–5) TargetProtocolAddr (bytes 0–3) SourceProtocolAddr (bytes 2 –3) Hardware type = 1ProtocolType = 0x0800 SourceHardwareAddr (bytes 4 –5) TargetHardwareAddr (bytes 0 –1) SourceProtocolAddr (bytes 0 –1) HLen = 48PLen = 32 Operation SourceHardwareAddr ( bytes 0 – 3) 081631 HLen = Hardware Address Length PLen = Protocol Address Length

25 Univ. of TehranIntroduction to Computer Network25 Internet Control Message Protocol (ICMP) Echo (ping) Redirect (from router to source host) Destination unreachable (protocol, port, or host) TTL exceeded (so datagrams don’t cycle forever) Checksum failed Reassembly failed Cannot fragment

26 Univ. of TehranIntroduction to Computer Network26 Tunneling Big companies having different networks want to connect them together. Virtual Private Network (VPN) Use leased line to connect networks. Use Internet (Shared line). Sloution Encapsulate packets in R1 in IP packets for destination R2. Network 1 Network 2 R1 R2 Internet Virtual line

27 Univ. of TehranIntroduction to Computer Network27 IP Address Problem (1991) Inefficient use of Hierarchical Address Space class C with 2 hosts (2/255 = 0.78% efficient) class B with 256 hosts (256/65535 = 0.39% efficient) Address space depletion In danger of running out of classes A and B Class C too small for most domains Very few class A – IANA (Internet Assigned Numbers Authority) very careful about giving Class B – greatest problem

28 Univ. of TehranIntroduction to Computer Network28 IP Address Utilization (‘98) http://www.caida.org/outreach/resources/learn/ipv4space/

29 Univ. of TehranIntroduction to Computer Network29 Solutions for IP Address Better utilize address space Subnetting Supperneting Locally use unofficial IP addresses (NATing) Use wider IP addresses New version of IP, IPv6.

30 Univ. of TehranIntroduction to Computer Network30 Subnetting Add another level to address/routing hierarchy: subnet Subnet masks define variable partition of host part Subnets visible only within site Network number Host number Class B address Subnet mask (255.255.0.0) Subnetted address 1111111111111111111 0000000000000000 Network numberHost IDSubnet ID

31 Univ. of TehranIntroduction to Computer Network31 Subnet Example Forwarding table at router R1 Subnet # Subnet Mask Next Hop 128.96.34.0 255.255.255.128 interface 0 128.96.34.128 255.255.255.128 interface 1 128.96.33.0 255.255.255.0 R2 Subnet mask: 255.255.255.128. Subnet number: 128.96.34.0 128.96.34.15 128.96.34.1 H1 R1 128.96.34.130 Subnet mask: 255.255.255.128 Subnet number: 128.96.34.128 128.96.34.129 128.96.34.139 R2 H2 128.96.33.1 128.96.33.14 Subnet mask: 255.255.255.0 Subnet number: 128.96.33.0 H3 111….1.0xxx….x Net host Subnet

32 Univ. of TehranIntroduction to Computer Network32 Forwarding Algorithm D = destination IP address for each entry (SubnetNum, SubnetMask, NextHop) D1 = SubnetMask & D if D1 = SubnetNum if NextHop is an interface deliver datagram directly to D else deliver datagram to NextHop Use a default router if nothing matches Not necessary for all 1s in subnet mask to be contiguous Can put multiple subnets on one physical network Subnets not visible from the rest of the Internet

33 Univ. of TehranIntroduction to Computer Network33 Supernetting Assign block of contiguous network numbers to nearby networks Called CIDR: Classless Inter-Domain Routing Represent blocks with a single pair (first_network_address, count) Restrict block sizes to powers of 2 Use a bit mask (CIDR mask) to identify block size All routers must understand CIDR addressing

34 Univ. of TehranIntroduction to Computer Network34 Classless Addressing CIDR ABCD 0 2 32 -1 0 128.9/16 128.9.0.0 2 16 142.12/19 65/8 Classless: Class-based: 128.9.16.14

35 Univ. of TehranIntroduction to Computer Network35 Classless Addressing CIDR 0 2 32 -1 128.9/16 128.9.16.14 128.9.16/20128.9.176/20 128.9.19/24 128.9.25/24 Most specific route = “longest matching prefix”

36 Univ. of TehranIntroduction to Computer Network36 Forwarding Datagrams 128.9/16 128.9.16/20 128.9.176/20 128.9.19/24 128.9.25/24 142.12/19 65/8 PrefixPort 3 2 1 7 2 1 3 128.17.14.1 128.17.20.1 128.17.10.1 128.17.14.1 128.17.16.1 Next-hop R1 R2 R3 R4 1 2 3 128.17.20.1 128.17.16.1 e.g. 128.9.16.14 => Port 1

37 Univ. of TehranIntroduction to Computer Network37 Default Routing R1 R2R3R4R5 Default Routing Requires Routing Table Default Routing

38 Univ. of TehranIntroduction to Computer Network38 Inside a Router Forwarding Decision Forwarding Decision Forwarding Decision Forwarding Table Forwarding Table Forwarding Table Interconnect Output Scheduling 1. 2. 3.

39 Univ. of TehranIntroduction to Computer Network39 NAT: Network Address Translation IP addresses need to be unique when we are going outside of our network. We can use whatever IP address as long as we are functioning inside our own network. Translate to a valid IP address when going out. Do reverse when coming in.

40 Univ. of TehranComputer Network40 Mobile IP: Motivation Connectivity everywhere Overlapping, heterogeneous networks Small, portable devices Maintaining ongoing connections as the user moves Why maintain connectivity? Avoid restarting applications/networks Avoid losing “distributed state”

41 Problems? The IP address associated with a mobile host is network dependent! When user connects to another network, IP address needs to change Packets belonging to ongoing connections somehow need to be delivered to the mobile host Solutions? Any solution should be transparent

42 Intuitive Solution Take up the analogy of you moving from one apartment to another What do you do? Leave a forwarding address with your old post-office! The old post-office forwards mails to your new post-office, which then forwards them to you

43 Univ. of TehranComputer Network43 Basic Mobile IP MH = mobile host CH = correspondent host HA = home agent FA = foreign agent (We’ll see later that FA is not necessary or even desirable) MH registers new “care-of address” (FA) with HA HA tunnels packets to FA FA decapsulates packets and delivers them to MH HA CH Home network Foreign network FAMH

44 Univ. of TehranComputer Network44 Packet Tunneling Source address = address of CH Destination address = home IP address of MH Payload Source address = address of HA Destination address = care-of address of MH Source address = address of CH Destination address = home IP address of MH Original payload Packet from CH to MH Home agent intercepts above packet and tunnels it

45 Univ. of TehranComputer Network45 host moves again HA CH Home network Foreign network #1 FA #1MH Foreign network #2 FA #2MH MH registers new address (FA #2) with HA & FA #1 HA tunnels packets to FA #2, which delivers them to MH Packets in flight can be forwarded from FA #1 to FA #2

46 Univ. of TehranComputer Network46 Basic Mobile IP (cont) HA CH Home network Foreign network FAMH Mobile hosts also send packets Mobile host uses its home IP address as source address -Lower latency -Still transparent to correspondent host -No obvious need to encapsulate packet to CH This is called a “triangle route”

47 Univ. of TehranComputer Network47 Mobile IP (RFC 2002) Leaves Internet routing fabric unchanged Does assume “foreign Agent ” exist everywhere Simple Correspondent hosts don’t need to know about mobility Works both for changing domains and network interfaces

48 Univ. of TehranIntroduction to Computer Network48 IP Version 6 Features 128-bit addresses (classless) multicast real-time service authentication and security autoconfiguration Any cast address protocol extensions Header 40-byte “base” header extension headers (fixed order, mostly fixed length) No fragmentation source routing authentication and security other options

49 Univ. of TehranIntroduction to Computer Network49 IPV6: Packet format Next header: IP option and protocol fields in IPv4. If options (i.e. fragmentation) indicated by this field, otherwise, it is protocol fields. VersionTrafficClass FlowLabel PayloadLen NextHeaderHopLimit SourceAddr (16 bytes) DestinationAddr (16 bytes) 04 12 16 2431 Next header/ Data … …


Download ppt "Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE."

Similar presentations


Ads by Google