CSNETWK Routing and Forwarding 3rd Term AY2023-2024 PDF
Document Details
Uploaded by Deleted User
2024
CSNETWK
Tags
Summary
This document is a past paper for the CSNETWK Routing and Forwarding course, covering the 3rd term of AY2023-2024. It outlines various topics including network layer functions, IP protocols like IPv4 and IPv6, and concepts such as subnetting and DHCP.
Full Transcript
CSNETWK Routing and Forwarding 3rd Term AY2023 – 2024 Outline Network Layer functions Forwarding Routing Internet Protocol (IP) IPv4 Datagram format Addressing DHCP ICMP NAT IPv6 Network (IP) layer supervises host-to-host packet delivery transport layer –...
CSNETWK Routing and Forwarding 3rd Term AY2023 – 2024 Outline Network Layer functions Forwarding Routing Internet Protocol (IP) IPv4 Datagram format Addressing DHCP ICMP NAT IPv6 Network (IP) layer supervises host-to-host packet delivery transport layer – process-to- process data link layer – node-to-node services and protocols transport segment from sending to receiving host mobile network sender: encapsulates segments into datagrams, passes to link layer national or global ISP receiver: delivers segments to transport layer protocol application network layer protocols in every transport network link Internet device: hosts, routers physical network link network link physical physical routers examines header fields in all IP datagrams passing network link network link through it physical physical network link datacenter moves datagrams from input ports to output ports physical network to transfer datagrams along end-end path application transport network enterprise link network physical Two key network-layer functions forwarding: move packets from a router’s input link to appropriate DATA PLANE router output link routing: determine route taken by packets from source to destination CONTROL PLANE routing algorithms Two key network-layer functions Data plane: Control plane: local, per-router function network-wide logic determines how datagram arriving on determines how datagram is routed router input port is forwarded to among routers along end-end path router output port from source host to destination host Router A router is a computer. CPU an operating system memory. Internet protocol Internet protocol transport layer: TCP, UDP IP protocol Path-selection datagram format algorithms: addressing network implemented in packet handling conventions forwarding layer routing protocols table ICMP protocol error reporting router “signaling” link layer physical layer Internet protocol IP is a connectionless protocol No dedicated end-to-end connection is created before data is sent. Senders do not know whether or not the destination is present, reachable, or functional before sending packets. IP is a Best Effort Delivery protocol: IP is considered “unreliable” because it does not guarantee that all packets that are sent will be received. IP – Media Independent Operates independently from the media that carries the data IP Fragmentation network links have MTU (max.transfer size) - largest possible link-level frame fragmentation: … different link types, different MTUs in: one large datagram out: 3 smaller datagrams large IP datagram divided (“fragmented”) within net one datagram becomes several reassembly datagrams “reassembled” only at final destination … IP header bits used to identify, order related fragments IPv4 datagram format 32 bits IP protocol version number type of total datagram ver head. length length (bytes) header length(bytes) len service fragment fragmentation/ “type” of service: 16-bit identifier flgs diffserv (0:5) offset reassembly time to upper header ECN (6:7) header checksum live layer checksum TTL: remaining max hops source IP address 32-bit source IP address (decremented at each router) Maximum length: 64K bytes destination IP address 32-bit destination IP address upper layer protocol (e.g., TCP or UDP) Typically: 1500 bytes or less options (if any) e.g., timestamp, record overhead route taken 20 bytes of TCP payload data 20 bytes of IP (variable length, = 40 bytes + app typically a TCP layer overhead for or UDP segment) TCP+IP Ipv4 addressing IP address: 32-bit identifier 223.1.1.1 associated with each host or 223.1.2.1 router interface 223.1.1.2 223.1.1.4 223.1.2.9 interface: connection between host/router and physical link 223.1.1.3 223.1.3.27 223.1.2.2 router’s typically have multiple interfaces host typically has one or two interfaces 223.1.3.1 223.1.3.2 (e.g., wired Ethernet, wireless 802.11) dotted-decimal IP address notation: 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1 IPv4 Address Binary numbering system consists of the numbers 0 and 1 called bits IPv4 addresses are expressed in 32 binary bits divided into 4 8-bit octets 192.168.10.79 11000000.10101000.00001010.01001111 IPv4 Address An IPv4 address is hierarchical. Composed of a Network portion and Host portion. All devices on the same network must have the identical network portion. Network portion Host portion 192.168.10.79 11000000.10101000.00001010.01001111 IPv4 Address class IPv4 Address class Subnet mask Subnet mask identifies the network/host portion of the IPv4 address. Subnets What’s a subnet ? 223.1.1.1 device interfaces that can physically 223.1.2.1 reach each other without passing 223.1.1.2 through an intervening router 223.1.1.4 223.1.2.9 IP addresses have structure: 223.1.1.3 223.1.3.27 subnet part: devices in same subnet 223.1.2.2 have common high order bits host part: remaining low order bits 223.1.3.1 223.1.3.2 network consisting of 3 subnets IPv4 Address Types of Addresses in Network 192.168.10.0/24 Network Address - host portion is all 0s (.00000000) First Host address - host portion is all 0s and ends with a 1 (.00000001) Last Host address - host portion is all 1s and ends with a 0 (.11111110) Broadcast Address - host portion is all 1s (.11111111) IPv4 Address: CIDR CIDR: Classless InterDomain Routing (prefix length) subnet portion of address of arbitrary length shorthand method of expressing the subnet mask address format: a.b.c.d/x, where x is # bits in subnet portion of address Subnetting or subnetworking The process of obtaining additional bits from the left most or the most significant bits of the Host portion of the network in order to further divide the network into smaller subnetworks Used to conserve the number of IP Addresses available and decrease the unused IP Addresses of networks with few hosts in relation to the IP Address range Fixed Length Subnet Masking Variable Length Subnet Masking Fixed Length Subnet Mask Refers to a strategy where every one of your networks within your infrastructure is the same size. Image from: https://www.practicalnetworking.net/stand-alone/classful-cidr-flsm-vlsm/ example: FLSM Network Address: 192.10.10.0 Network Host Portion Portion Required Subnets: 16 Step#1: Convert the Host Portion of Network Address Binary Step#2: From the MSB of the Host Portion, count how many subnets needed to create. Step#3: From the LSB of the Host Portion until the division of subnets created, count how many hosts addresses on each subnet. Step#4 To determine the custom subnet mask, change the bits of the default subnet mask host # of subnets 16 16 2 4 8 # of hosts/subnet 8 4 2 portion (binary; depends on how many bits borrowed; in this case, 4 bits) 192.10.10.0 0 000000 Step#5 Count the 1s in custom subnet mask to get the prefix (in this case, 8+8+8+4=28) # of bits borrowed 1 1 1 1 255.255.255.0 0 0 00000 # of bits borrowed 1 1 1 1 255.255.255.240 or 11111111.11111111.11111111.11110000 28 1s Network Address: 192.10.10.0/28 example: FLSM (cont.) Network Address: 192.10.10.0/28 # of subnets created: 16 Total # of addresses: 16 x 16 = 256 Total # of usable host addresses: 16 subnets x (16 addresses-2) =224 NOTE: 14 usable host First and last addresses on each subnet are assignable to subnet address and subnet broadcast address, respectively. addresses in between Subnet Broadcast Subnet Address Subnet Address Subnet Broadcast Address Address (0) 192.10.10.0 ---------- 192.10.10.15 (8) 192.10.10.128 ---------- 192.10.10.143 (1) 192.10.10.16 ---------- 192.10.10.31 (9) 192.10.10.144 ---------- 192.10.10.159 (2) 192.10.10.32 ---------- 192.10.10.47 (10) 192.10.10.160 ---------- 192.10.10.175 (3) 192.10.10.48 ---------- 192.10.10.63 (11) 192.10.10.176 ---------- 192.10.10.191 (4) 192.10.10.64 ---------- 192.10.10.79 (12) 192.10.10.192 ---------- 192.10.10.207 (5) 192.10.10.80 ---------- 192.10.10.95 (13) 192.10.10.208 ---------- 192.10.10.223 (6) 192.10.10.96 ---------- 192.10.10.111 (14) 192.10.10.224 ---------- 192.10.10.239 (7) 192.10.10.112 ---------- 192.10.10.127 (15) 192.10.10.240 ---------- 192.10.10.255 example: FLSM 192.168.1.0/24 needs 6 subnetworks to accommodate the following subnetworks: A – 20 hosts B – 14 hosts C – 10 hosts D – 8 hosts E – 7 hosts F – 2 hosts example: FLSM 192.168.1.0/24 needs 6 subnetworks to accommodate the following subnetworks: A – 20 hosts 1. Identify the largest number of host required in a subnet. B – 14 hosts C – 10 hosts 20 hosts, nearest: 2^x 5; D – 8 hosts E – 7 hosts 2^5 = 32-2 (network + broadcast IP) = F – 2 hosts 30 hosts addresses per subnet ✅ 2. Check the prefix to identify if the remaining bits are enough to create the required subnets. /24 8 remaining bits out of 32 total bits (IP address) 8 – 5 (host bits) = 3 bits 2^3 = 8 subnets ✅ 3. Split the subnet using the value from 2 by borrowing from the most significant bits of the host portion in your network. /24 + 3 bits /27 4. Allocate each equally divided subnet to the given networks. example: FLSM 192.168.1.0/24 needs 6 subnetworks to accommodate the following subnetworks: A – 20 hosts 4. Allocate each equally divided subnet to the given networks. B – 14 hosts C – 10 hosts D – 8 hosts Subnet E – 7 hosts Network Address Usable Addresses Range Broadcast Address F – 2 hosts ID 0 192.168.1.0/27 192.168.1.1 - 192.168.1.30 192.168.1.31/27 1 192.168.1.32/27 192.168.1.33 - 192.168.1.62 192.168.1.63/27 2 192.168.1.64/27 192.168.1.65 - 192.168.1.94 192.168.1.95/27 3 192.168.1.96/27 192.168.1.97 - 192.168.1.126 192.168.1.127/27 4 192.168.1.128/27 192.168.1.129 - 192.168.1.158 192.168.1.159/27 5 192.168.1.160/27 192.168.1.161 - 192.168.1.190 192.168.1.191/27 6 192.168.1.192/27 192.168.1.193 - 192.168.1.222 192.168.1.223/27 7 192.168.1.224/27 192.168.1.225 - 192.168.1.254 192.168.1.255/27 Note: Subnet 0 to 5 can be assigned to network A-F. There are 2 unused subnets (60 IP addresses) example: FLSM 172.16.0.0/22 needs 3 subnetworks to accommodate the following subnetworks: A – 127 hosts B – 62 hosts C – 12 hosts example: FLSM 172.16.0.0/22 needs 3 subnetworks to accommodate the following subnetworks: A – 127 hosts B – 62 hosts 1. Identify the largest number of host required in a subnet. C – 12 hosts 127 hosts, nearest: 2^x 8; 2^8 = 256-2 (network + broadcast IP) = 254 hosts addresses/subnet ✅ 2. Check the prefix to identify if the remaining bits are enough to create the required subnets. /22 10 remaining bits out of 32 total bits (IP address) 10 – 8 (host bits) = 2 bits 2^2 = 4 subnets ✅ 3. Split the subnet using the value from 2 by borrowing from the most significant bits of the host portion in your network. /22 + 2 bits /24 4. Allocate each equally divided subnet to the given networks. example: FLSM 172.16.0.0/22 needs 3 subnetworks to accommodate the following subnetworks: A – 127 hosts B – 62 hosts 4. Allocate each equally divided subnet to the given networks. C – 12 hosts Subnet Network Address Usable Addresses Range Broadcast Address ID 0 172.16.0.0/24 172.16.0.1 - 172.16.0.254 172.16.0.255/24 1 172.16.1.0/24 172.16.1.1 - 172.16.1.254 172.16.1.255/24 2 172.16.2.0/24 172.16.2.1 - 172.16.2.254 172.16.2.255/24 3 172.16.3.0/24 172.16.3.1 - 172.16.3.254 172.16.3.255/24 Note: Subnet 0 to 2 can be assigned to network A-C. There are 1 unused subnet (254 IP addresses) practice NETWORK ADDRESS: 148.75.0.0 /26 Answer the ff: 1) Address Class 2) Default Subnet Mask 3) Custom Subnet Mask 4) Total # of subnets 5) Total # of addresses 6) Total # of usable addresses practice NETWORK ADDRESS: 178.100.0.0 Required Subnets: 2000 Answer the ff: 1) Address Class 2) Default Subnet Mask 3) Custom Subnet Mask 4) Total # of subnets 5) Total # of host addresses 6) Total # of usable addresses Determining network and broadcast address IP address: 192.168.1.182 /24 To check its network address, perform AND operation to its subnet mask. 192.168.1.182 11000000. 10101000. 00000001. 10110110 /24 11111111. 11111111. 11111111. 00000000 11000000. 10101000. 00000001. 00000000 192.168.1.0 Network Address Determining network and broadcast address IP address: 192.168.1.182 /24 To check its broadcast address, perform OR operation to its subnet mask (flip). 192.168.1.182 11000000. 10101000. 00000001. 10110110 /24 00000000. 00000000. 00000000. 11111111 11000000. 10101000. 00000001. 11111111 192.168.1.255 Broadcast Address Ipv4 Communication Unicast Broadcast Multicast one to one one to all. One to a select group communication. DHCP DHCP: Dynamic Host 223.1.1.0/24 DHCP Configuration Protocol server 223.1.2.1 223.1.1.1 allow host to dynamically obtain its IP address from 223.1.1.2 arriving DHCP network server when it 223.1.1.4 223.1.2.9 client needs joins network address in this 223.1.2.2 network can renew its lease on address in 223.1.1.3 223.1.3.27 use 223.1.2.0/24 allows reuse of addresses (only hold address while connected/“on”) 223.1.3.1 223.1.3.2 support for mobile users who want to join network (more shortly) 223.1.3.0/24 DHCP DHCP server: 223.1.2.5 DHCP discover arriving client src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 DHCP offer src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 654 lifetime: 3600 secs DHCP request src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 223.1.2.4 transaction ID: 655 lifetime: 3600 secs DHCP ACK src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 655 lifetime: 3600 secs DHCP DHCP returns: IP address address of first-hop router for client name and IP address of DNS sever network mask (indicating network versus host portion of address) Limitations of ipv4 Three major issues still exist with IPv4: IP address depletion Internet routing table expansion Lack of end-to-end connectivity Public and Private IPv4 Addresses Private Address Blocks 10.0.0.0 /8 or 10.0.0.0 to 10.255.255.255 172.16.0.0 /12 or 172.16.0.0 to 172.31.255.255192.168.0.0 /16 192.168.0.0 to 192.168.255.255 NAT:Network Address translation ICMP ICMP is the messaging protocol used by hosts & routers to communicate network-level information error reporting: unreachable host, network, port, protocol echo request/reply (used by ping) ICMP messages common to both include: Host confirmation Destination or Service Unreachable Time exceeded Route redirection ipv6 Has a larger 128-bit address space 340 undecillion addresses Solves limitations with IPv4 motivation 32-bit address space soon to be completely allocated. header format helps speed processing/forwarding header changes to facilitate QoS Ipv6 address IPv6 Addresses: 128 bits in length Every 4 bits is represented by a single hexadecimal digit 2001:0DB8:0000:1111:0000:0000:0000:0200 Ipv6 Address Reduce or compress IPv6 Omit leading zeros in any segment. Omit All 0 Segments 2001:0DB8:0000:1111:0000:0000:0000:0200 Ipv6 datagram format Priority identify priority among datagrams in flow flow Label identify datagrams in same “flow.” next header identify upper layer protocol for data References Several contents of these slides are adapted from Computer Networking: A Top- Down Approach (2013, Kurose). Kurose, James F. (2013). Computer networking : a top-down approach. Pearson. TK5105.875.I57 K88 2013b Forouzan, B. (2013). Data Communications and Networking, McGraw Hill. TK5105.F65 2013 "The information and data contained in the online learning modules, such as the content, audio/visual materials or artwork are considered the intellectual property of the author and shall be treated in accordance with the IP Policies of DLSU. They are considered confidential information and intended only for the person/s or entities to which they are addressed. They are not allowed to be disclosed, distributed, lifted, or in any way reproduced without the written consent of the author/owner of the intellectual property."