Download presentation
Presentation is loading. Please wait.
1
Kazi Fall 2007 CSCI 370/EENG 4801 CSCI-370/EENG-480 Computer Networks Khurram Kazi
2
Kazi Fall 2007 CSCI 370/EENG 4802 Major sources of the slides for this lecture Slides from Tanenbaum’s and William Stallings’ website are used in this lecture Interworking with TCP/IP, M9000-02, Global knowledge, training manual, (http://am.globalknowledge.com)http://am.globalknowledge.com Teach yourself TCP/IP in 24 hours, Joe Casad, Bob Willsey, SAMS The Internet and Its Protocol, Adrian Farrel’s book.
3
Kazi Fall 2007 CSCI 370/EENG 4803 Reference Network: For discussion purposes
4
Kazi Fall 2007 CSCI 370/EENG 4804 Ethernet frame SFD = Start of Frame Delimiter D Addr = Destination Address S Addr = Source Address FCS = Frame Check Sequence
5
Kazi Fall 2007 CSCI 370/EENG 4805 Address Resolution Protocol (ARP) RFC 826 Consider two machines A and B that connect to the same physical network. Each has an assigned IP address I A and I B and a physical address P A and P B. The goal is to devise low-level software that hides physical addresses and allows higher-level programs to work only with internet addresses. Ultimately, however, communication must be carried out by physical networks using whatever physical address scheme the underlying network supplies. The problem of mapping high-level addresses to physical address is known as the address resolution problem.
6
Kazi Fall 2007 CSCI 370/EENG 4806 Address Resolution Protocol (ARP) Imagine a router receives a packet. It looks up the destination IP address carried by the packet and determines the next hop to which to forward the packet – there is a chance that the destination is attached to the router. This tells the router out of which interface it should send the packet. If the link from the router is point-to-point, things will be simple as the router can simply wrap the packet in a data-link layer protocol and send it. However, if the link is multihop link like Ethernet (a link where multiple nodes are attached). Hence, the router needs the data-link layer address (such as MAC address) to forward the packet to the proper node. IPv4 address (4 octets) IS NOT EQUAL to MAC address (6 octets) in length. This does not allow the MAC address to be carried in the 4-octet IP address field. Moreover, in IP, at times it is desired to be able to assign multiple addresses to a single node.
7
Kazi Fall 2007 CSCI 370/EENG 4807 Address Resolution Protocol (ARP) need MAC address to send to LAN host manual included in network address use central directory use address resolution protocol ARP (RFC 826) provides dynamic IP to Ethernet address mapping source broadcasts ARP request destination replies with ARP response
8
Kazi Fall 2007 CSCI 370/EENG 4808 Format of ARP Message encapsulated in Ethernet
9
Kazi Fall 2007 CSCI 370/EENG 4809 Addressing scheme in IP Three key 32-bit fields (areas of information) within the IP software are integral to its operation IP Address– A unique 32 bit address assigned to a computer or more accurately to a node Subnet Mask Field– A 32 bit pattern of bits used to tell IP how to determine which part of the IP address is network portion and which part is the host portion Default gateway field– An optional 32 bit address that, if present, identifies the address of a router. Datagrams destined to another network are sent to this address to be routed appropriately
10
Kazi Fall 2007 CSCI 370/EENG 48010 IP Addressing IP address is divided into two parts Network ID Host ID Network ID can be synonymous to a street name; every house on the street uses the same street name. Likewise every computer on a network uses the same network ID. Similar to every house on the street has a unique street address, each computer on a network has a different host ID.
11
Kazi Fall 2007 CSCI 370/EENG 48011 IP Addressing Some network administrator use parts of the local bits (bits used for local host IDs) to create more manageable pieces called subnets (subnetworks). Therefore, there can be network, subnet, and host fields of an IP address. Some rules to the IP address and those fields: No field of an interface’s IP address may contain all 1s or all 0s All 1s in the host portion of a target IP address signify an IP-level broadcast All 0s in the host portion of an IP address identify a subnet or a network Subnet: Breaking network address into multiple addresses
12
Kazi Fall 2007 CSCI 370/EENG 48012 IPv4 Address Formats
13
Kazi Fall 2007 CSCI 370/EENG 48013 IP Addresses - Class A Class A network contains 8 bit network ID and 24 bit host ID => Class network can approximately support 2 24 (16,777,216 computers). In reality the number of computers is less than that number (all 1s or all 0s eliminated). Left most bit is always a 0 all 0 reserved 01111111 (127) reserved for loopback or local host range 1.x.x.x to 126.x.x.x (usable range) Network administrators frequently separate the network into smaller subnets. Class A addresses are assigned to large organizations such as Ford Motor Company, MIT etc. 0NNNNNNN 1-127 LLLLLLLL N = Net; L = Locally administered.
14
Kazi Fall 2007 CSCI 370/EENG 48014 IP Addresses - Class B Class B addresses start with binary 10 range 128.x.x.x to 191.x.x.x second octet also included in network address 2 14 = 16,384 class B addresses Without subnetting, 65,534 addresses can be used within a flat network. Class B networks are assigned to midsize organizations such as colleges and universities. 10NNNNNN 128-191 NNNNNNNN 0-255 LLLLLLLL N = Net; L = Locally administered.
15
Kazi Fall 2007 CSCI 370/EENG 48015 IP Addresses - Class C start with binary 110 range 192.x.x.x to 223.x.x.x second and third octet also part of network address 2 21 = 2,097,152 network addresses Class C networks typically do not need subnetting for management, unless they contain smaller workgroups in a diverse location More often, organizations subnet Class C networks to restrict access to specific resources. 110NNNNN 192-223 NNNNNNNN 0-255 NNNNNNNN 0-255 LLLLLLLL N = Net; L = Locally administered.
16
Kazi Fall 2007 CSCI 370/EENG 48016 IP Addresses - Class D Class D addresses have the first three bits set to a 1 and fourth bit set to a 0. Class D addresses are used to reach groups by assigning the same multicast address to all members of the group. These group members also have their own individual Class A, B, or C host IP address. There are millions of possible multicast addresses Class D addresses are designated for groups of users and therefore do not have host portions for assignment to individual interfaces. For that reason, Class D networks are not subnetted. 1110MMMM 224-239 MMMMMMMM 0-255 MMMMMMMM 0-255 MMMMMMMM 0-255 M= Multicast.
17
Kazi Fall 2007 CSCI 370/EENG 48017 Subnets A campus network consisting of LANs for various departments.
18
Kazi Fall 2007 CSCI 370/EENG 48018 Subnets and Subnet Masks allows arbitrary complexity of internetworked LANs within organization insulate overall internet from growth of network numbers and routing complexity site looks to rest of internet like single network each LAN assigned subnet number 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
19
Kazi Fall 2007 CSCI 370/EENG 48019 Subnetting IP Networks 191.255.193.44 IP decimal 255.255.252.0mask decimal 10111111111111111100000100101100IP binary 11111111111111111111110000000000mask binary NNNNNNNNNNNNNNNNSSSSSS I II I I I I I I Imask meaning In the mask, binary 1s indicate the position of the network and subnet portion of the IP address, while 0s identify bits that represent individual interfaces. N – NetS – SubnetI – Interface The natural mask is the mask that represents the bits used by the network number in Class A, B & C networks A: 255.0.0.0 B: 255.255.0.0 C: 255.255.255.0 Additional bits in a mask in excess of the natural mask for the network class indicates a subnetted network Subnet mask shown above can also be represented as 191.255.0.0/22: suggesting that the class B network uses a mask that identifies the first 22 bits of the 32-bit IP address as the network and subnet fields. Since first 16 bits identify the network, the remaining 6 bits set the subnet field.
20
Kazi Fall 2007 CSCI 370/EENG 48020 Subnet Calculations Example: The number of subnets or hosts in a subnet: (2 n ) – 2 (n = the number of bits used in the mask) With 4 bits in the host field of the mask: (2 4 ) – 2 = 16 – 2 = 14 hosts With three bits in the subnet field of the mask (2 3 ) – 2 = 8 – 2 = 6 subnets The (-2) term comes from invalid entries of all 1s or all 0s in the field. Questions to ask when subnetting is used: How many subnets an organization need from its network What is the maximum number of interfaces that the largest subnet needs to support To answer these questions, limits of the class of network plus the rules of IP addressing need to be considered No field (network, subnet or host) may contain all 1s or all 0s (binary) There cannot be a mask with a subnet field of 1 bit
21
Kazi Fall 2007 CSCI 370/EENG 48021 IP Routing Rules IP datagrams can travel over the network in two ways: Local routing – The datagram is sent directly to a device on the same physical network as the sending device Indirect routing – If the target device is on another physical network, IP must send the datagram to another device (a router) for help in getting it to the target.
22
Kazi Fall 2007 CSCI 370/EENG 48022 IP Routing Rules IP decides if a device is on a local network by evaluating the source and target IP addresses. While the IP stack does a series of binary manipulations to make the routing decision, a simple set of rules clearly describes the result of the process: 1.If two address are in different classes, the datagram is sent to the router for forwarding 2.If the two addresses are in the same class but in different network, the datagram is sent to the router for forwarding 3.If the two addresses are in the same class and network, but in different subnets, the datagram is sent to the router for forwarding 4.At this point, the source and target addresses are in the same network and subnet so the datagram is sent directly to the target computer
23
Kazi Fall 2007 CSCI 370/EENG 48023 IP Routing: Are these addresses on the Same Subnet? How do we determine if the source and the target IP addresses are in the same subnet? The subnet field in both addresses must have the same value. How do we know if they have the same value? We know if it by locating the subnet field and then checking the values to see if they are the same
24
Kazi Fall 2007 CSCI 370/EENG 48024 IP Routing: Are these addresses on the Same Subnet? Example 1: Determine if the addresses are in the same subnet: Source – 161.55.121.33 Target – 161.155.131.49 These are Class B addresses and are in the same network; the 161.55.0.0 network To determine if they are in the same subnet, we must also have the subnet mask. Assume we are using the subnet mask 255.255.248.0 Keep in mind that subnet field is locally administered portion of the addresses and is indicated by the 1 bits in the locally administered portion of the mask.
25
Kazi Fall 2007 CSCI 370/EENG 48025 IP Routing: Are these addresses on the Same Subnet? Example 1 (continued): Binary value 12864321684211286432168421 Source0111100100100001 Mask1111100000000000 Target1000001100110001 Local portion of the source address is 121.33 (7B.21 Hex). Local portion of the target address is 131.49 (83.31 Hex) Local portion of the mask is 248.0 (F8.0 Hex) First 5 bits are 1, telling us the we have five-bit mask. Source AND Mask = 01111 Target AND Mask = 10000 Hence not in the same subnet
26
Kazi Fall 2007 CSCI 370/EENG 48026 IP Routing: Are these addresses on the Same Subnet? Example 2: Determine if the addresses are in the same subnet: Source – 204.238.7.50 Target – 204.238.7.66 Mask – 255.255.255.240 These are Class C addresses and are in the same network; the 204.238.7.0 network
27
Kazi Fall 2007 CSCI 370/EENG 48027 IP Routing: Are these addresses on the Same Subnet? Example 2 (continued): Binary value 1286432168421 Source00110010 Mask11110000 Target01000010 Local portion of the source address is 50 (32 Hex). Local portion of the target address is 66 (42 Hex) Local portion of the mask is 240 (F0 Hex) First 4 bits are 1, telling us the we have four-bit mask. Source AND Mask = 0011 Target AND Mask = 0100 Hence not in the same subnet
28
Kazi Fall 2007 CSCI 370/EENG 48028 IP Routing: Are these addresses on the Same Subnet? Example 3: Determine if the addresses are in the same subnet: Source – 200.1.1.69 Target – 200.1.1.135 Mask – 255.255.255.224 These are Class C addresses and are in the same network; the 200.1.1.0 network
29
Kazi Fall 2007 CSCI 370/EENG 48029 IP Routing: Are these addresses on the Same Subnet? Example 3 (continued): Binary value 1286432168421 Source01000101 Mask11100000 Target10000111 Local portion of the source address is 69 (45 Hex). Local portion of the target address is 135 (87 Hex) Local portion of the mask is 240 (E0 Hex) First 4 bits are 1, telling us the we have four-bit mask. Source AND Mask = 0100 Target AND Mask = 1000 Hence not in the same subnet
30
Kazi Fall 2007 CSCI 370/EENG 48030 Subnets A campus network consisting of LANs for various departments.
31
Kazi Fall 2007 CSCI 370/EENG 48031 The Network Layer Chapter 5
32
Kazi Fall 2007 CSCI 370/EENG 48032 Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer Implementation of Connectionless Service Implementation of Connection-Oriented Service Comparison of Virtual-Circuit and Datagram Subnets
33
Kazi Fall 2007 CSCI 370/EENG 48033 Store-and-Forward Packet Switching The environment of the network layer protocols. fig 5-1
34
Kazi Fall 2007 CSCI 370/EENG 48034 Implementation of Connectionless Service Routing within a diagram subnet.
35
Kazi Fall 2007 CSCI 370/EENG 48035 Implementation of Connection-Oriented Service Routing within a virtual-circuit subnet.
36
Kazi Fall 2007 CSCI 370/EENG 48036 Comparison of Virtual-Circuit and Datagram Subnets 5-4
37
Kazi Fall 2007 CSCI 370/EENG 48037 Routing Algorithms The Optimality Principle Shortest Path Routing Flooding Distance Vector Routing Link State Routing Hierarchical Routing Broadcast Routing Multicast Routing Routing for Mobile Hosts Routing in Ad Hoc Networks
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.