Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data and Computer Communications

Similar presentations


Presentation on theme: "Data and Computer Communications"— Presentation transcript:

1 Data and Computer Communications
Internet Protocols

2 Network Architecture Features
Addressing Packet size Access mechanism Timeouts Error recovery Flow control Routing User access control Connection based or connectionless

3 Connectionless Internetworking
Advantages Flexibility Robust No unnecessary overhead Unreliable Not guaranteed delivery Not guaranteed order of delivery Packets can take different routes Reliability is responsibility of next layer up (e.g. TCP)

4 IP Operation IP PDU Encapsulated with LAN protocol
Go to Router X MAC address for Router X IP PDU Encapsulated with LAN protocol Encapsulated with X.25 protocol

5 Design Issues Routing Datagram lifetime Fragmentation and re-assembly
Error control Flow control

6 Routing End systems and routers maintain routing tables Source routing
Indicate next router to which datagram should be sent Static May contain alternative routes Dynamic Flexible response to congestion and errors Source routing Source specifies route as sequential list of routers to be followed

7 Datagram Lifetime Datagrams could loop indefinitely
Consumes resources Transport protocol may need upper bound on datagram life Datagram marked with lifetime Time To Live field in IP Once lifetime expires, datagram discarded (not forwarded) Hop count Decrement time to live on passing through a each router Time count Need to know how long since last router

8 Fragmentation and Re-assembly
Different packet sizes When to re-assemble At destination Results in packets getting smaller as data traverses internet Intermediate re-assembly Need large buffers at routers Buffers may fill with fragments All fragments must go through same router Inhibits dynamic routing

9 IP Fragmentation (1) IP re-assembles at destination only
Uses fields in header Data Unit Identifier (ID) Identifies end system originated datagram Source and destination address Protocol layer generating data (e.g. TCP) Identification supplied by that layer Data length Length of user data in octets

10 IP Fragmentation (2) Offset More flag
Position of fragment of user data in original datagram In multiples of 64 bits (8 octets) More flag Indicates that this is not the last fragment

11 Fragmentation Example
Application data IP header is the same as origin TCP header is not duplicated – More is the same as original

12 Internet Protocol (IP)
Part of TCP/IP Used by the Internet Specifies interface with higher layer e.g. TCP Specifies protocol format and mechanisms IPv4 addresses are 32 bits wide Its header is 20 bytes at minimum Uses doted-decimal notation (e.g ) IPv6 Provides larges address domain; addresses are 128 bits wide Multiple separate headers are supported Handles audio and video; providing high quality paths Supports unicast, multicast, anycast

13 Dealing with Failure Re-assembly may fail if some fragments get lost
Requires buffer Need to detect failure – but how? Re-assembly time out Assigned to first fragment to arrive If timeout expires before all fragments arrive, discard partial data Use packet lifetime (time to live in IP) If time to live runs out, kill partial data

14 Parameters (1) Source address Destination address Protocol
Recipient e.g. TCP Type of Service Specify treatment of data unit during transmission through networks Identification Source, destination address and user protocol Uniquely identifies PDU Needed for re-assembly and error reporting Send only + 0 - 3 4 - 7 8 - 15 Version Header length Type of Service Total Length 32 Identification Flags Fragment Offset 64 Time to Live Protocol Header Checksum 96 Source Address 128 Destination Address 160 Options + padding 192   Data  

15 IP Packet Format - TTL TTL (time-to-live) refers to the number of router hops the IP packet is allowed before it must be discarded. Each router that receives a packet subtracts one from the count in the TTL field. When the count reaches zero, the router detecting it discards the packet and sends an Internet Control Message Protocol (ICMP) message back to the originating host

16 IP Header The IP datagram contains data and IP address
The IP datagram is encapsulated in a frame with physical address The header changes as the frame goes from one network domain to the next IP Datagram Frame Data IP Address

17 Encapsulated IP Packet in Ethernet Frame
Ethernet Frame Carrying IP Packet MAC and Associated IP address

18 Encapsulated IP Packet in Ethernet Frame
Ethernet Frame Carrying IP Packet An Ethernet frame containing IP information has in its type field IP starting with 45 Hex indicates IPv4 with standard length of 20 bytes IP starting with 4F Hex indicates IPv4 with standard length of 60 bytes Remember: 24=16; 45= = One Byte Protocol Analyzer Display: C0 A C A A DC FF C0 99 B8 01 C0 99 0020 B8 03 2a B4 DD ….. Example: 99 is one byte

19 IP Addressing Two address types
Physical address (the frame has the physical address) Embedded in the hardware (NIC, e.g., ) Also called the Media Address Control (MAC) address Logical IP datagram contains the logical IP address To transport IP packets both physical and IP addresses must be known Static address resolution Dynamic address resolution How to map physical and IP addresses Local tables of IP addresses Centralized directory Address resolution mechanism Address resolution mechanisms ARP (address resolution protocol) – IP48 bit Ethernet address RARP (reverse) address resolution protocol are used to convert MAC to IP address and vice versa

20 IP Addressing – IPv4 A network address is divided into Netid and Hostid IP Address classification (number of hosts per network) Class Leading bits Network Address (Netid) Host Address (Hostid) Class A     0     7 bit (125)*     24 bit (16,777,151,750) Class B     10     14 bit (16,368)     16 bit (65,534) Class C     110     21 bit (2,096,896)     8 bit (254) Class D (multicast)     1110 Class E (reserved)     1111 * Some values are reserved!

21 IP Addressing Classification
Network Address Host Address Multicast Address Network Address Host Address Reserved for Internet research Network Address Host Address

22 Example of IP Addressing
Q1: Determine the network address for the following IP addresses: (84 = 54 Hex = )  Netid=  Class A  Hostid= (144 = 90 Hex = )  Netid=  Class B  Hostid= Q2: What type of IP address classification will a large organization with 1000 individual users in 150 dispersed buildings use?  Class B

23 IP Routing Protocols Routing packets requires having knowledge about the network Partial (know your own neighbors) Full (know the entire network elements) Retrieving network information (network discovery protocols) RIP (routing information protocol): routing based on the least number of hops OSPF (open shortest path first): Routing based on number of hops, link speed, congestion

24 TCP/IP Stack Protocol Bridge Router
IS used to connect two LANs using similar LAN protocols Address filter passing on packets to the required network only OSI layer 2 (Data Link) Router Connects two (possibly dissimilar) networks Uses internet protocol present in each router and end system OSI Layer 3 (Network)

25 Subnets and Subnet Masks
Subnets and Subnet Masks Each LAN assigned subnet number Site looks to rest of internet like single network Host portion of address partitioned into subnet number and host number Local routers route within subnetted network Subnet mask indicates which bits are subnet number and which are host number Allow arbitrary complexity of internetworked LANs within organization Insulate overall internet from growth of network numbers and routing complexity

26 Routing Using Subnets

27 Masking 3-bit subnet IP Address of B: 192.228.17.57 00 1|1 10 01
IP Address of A: | IP Address of X: | Subnet mask: 5-bit host Note: if we XOR IP Address of B & Subnet Mask We will have: XOR = Host number is 25  ; 192  , hence, Class C network (8-bit host/subnet) ! NetId SubNetId Host

28 Why Change IP? Address space exhaustion
Two level addressing (network and host) wastes space Network addresses used even if not connected to Internet Growth of networks and the Internet Extended use of TCP/IP Single address per host Requirements for new types of service

29 IP v6 Header vs. IPV4 Features: Extended address space
Note: IPv5 used for Stream Protocol- IP-layer protocol that provides end-to-end guaranteed service across a network. Features: Extended address space Improved option mechanism Dynamic address assignment Multicasting and anycasting Flow routing 128 bits 128 bits

30 Internet Addressing Over half million networks are connected to the Internet Network numbers are managed by ICNN (Internet Corporation for Assigned Names and Numbers) - Delegates part of address assignments to regional authorities IP addresses are given to ISPs and companies IP addresses are based on dotted decimal notation: IP address refer to machine’s own network when it is being booted (This host) broadcast on the LAN 127.x.y.z reserved for loopback testing

31 More about subnets…. Routers can be connected to multiple LANs
LANS are divided into subnets each identified by a subnet mask: (… )  32-10=22 to identify the subnet! Mask: netID + SunnetID or /22 (subnet mask is 22 bit long) Subnets are not visible outside the network Example: Assume subnet mask is /22 Subnet 1: Subnet 2:  …000010| Subnet 3:  …000011| Assume a packet’s destination is  which subnet does it belong to? Mask: … | Adrs: … | Hence: the packet must go to Subnet 3

32 Classes and subnets… Classful routing is not very efficient
Having IP address classes creates issues Addresses can be under utilized (Class A) Addresses can be over utilized (Class C) Management of addresses may be difficult Organizations can grow! Classless InterDomain Routing (CIDR) Allocate remaining IP addresses in variable-sized block; no regard to class! Use 32-bit mask! Uses a single routing table

33 Classless Routing - Example
What happens if a packet has an address of ? Where does it go? O: … AND  … ( ) How do you represent class B using CIDR? 16-bit NetID + 16-bit HostID  /16

34 Network Address Translation (NAT)
Addresses are growing! What is the solution? Use IPV6 Use NAT NAT: Allows using one IP address per company Internally new nodes can be added! How?

35 NAT Operation 198.60.42.12 IP reserved addresses
10.x.y.z x.y x.y Receiving a packet from the Internet Sender Add IP address TCP will have the destination port (0-1023) The port determines which server on the remote (destination) side to process the packet NAT box: Using the PORT address in TCP, change the IP address to a designated address ( ) Sending a packet into the Internet Changes to

36 NAT Issues… Addresses are not unique: many 10.0.0.1!
NAT controls are the incoming and outgoing packets – reliability! NAT accesses TCP and IP layers – layers should work independent of one another NAT only allows TCP/IP or UDP/IP NAT does not support applications which insert the IP address in the body (FTP or H.323)

37 Internet Control Protocols
IP protocol only deal with the data transfer We need control protocol to check the network ICMP, ARP, RARP, BOOTP, HDCP

38 Internet Control Message Protocol (ICMP)
ICMP error messages are used by routers and hosts to tell a device that sent a datagram about problems encountered in delivering it Used to test the network Messages are encapsulated in the IP packet Has many message types Code field is used for subtypes

39 ARP (address resolution protocol)
Exploits broadcast property of a LAN Each host on LAN maintains a a table of IP subnetwork addresses If the address can not be found ARP broadcasts a request Shouting: Who know about this IP address? Other hosts listen and reply The reply includes IP address and MAC Any interested host can learn about the new information

40 ARP Example Assume 1 is sending a message to 2 (rose@sonoma.edu)
Sonoma.edu is the host Host 1 sends a message to Domain Name System (DNS): what is the IP address for Sonoma.edu?  What is the MAC address for ? Use ARP broadcast! Host 2 respond: it is E2 Host 1 maps IP and MAC; encapsulate the IP message in the Ethernet frame and send it Cashing can enhance ARP operation

41 ARP Example Assume 1 is sending a message to 4 (rose@sonoma.edu)
Sonoma.edu is the host Host 1 sends a message to Domain Name System (DNS): what is the IP address for Sonoma.edu?  What is the MAC address for ? ARP cannot pass through the router! Two choices: Reconfigure routers to response to ARP (Proxy ARP) Send the message to the LAN router (E3)F1F34 – Each router looks are the IP address and passes it to the next node using the routing table

42 RARP and BOOTP Reverse ARP translates the Ethernet address to IP address A diskless machine when it is booking can ask: My MAC is ; what is my IP? RARP broadcasts the question (destination address is all one) Not passed through the router! Each LAN needs a RARP server! Bootstrap protocol uses UDP and forwards over routers Mapping must be done manually in each router! Uses one server but harder to implement!

43 Dynamic Host Configuration Protocol
DHCP allows many and automatic configuration Replaces BOOTP and RARP DHCP sends a DISCOVER Packet What is the IP address for this MAC? Even when an IP address is assigned, how long is it good for? Before the IP address is removed find another IP address….called Leasing

44 Remember… This is My MAC; what is my IP address? RARP / DHCP
This is the destination host name, what it is IP address? DNS Server This is the IP address, what is your` MAC address? ARP

45 References Tanenbaum Tomasi Text Book Comer Text book


Download ppt "Data and Computer Communications"

Similar presentations


Ads by Google