Internet
Internet
Internet
Internet comprises of large number of different access networks which are interconnected together by means of global internetwork. Global internetwork consists of an interconnected set of national, international ,networks all of which are interconnected together using devices called routers. Internet operates in packet-switched mode.
Transport protocols use this connectionless service to provide connectionless data delivery (UDP) and connection-oriented data delivery (TCP)
IP Datagrams
IP provides connectionless, unreliable delivery of IP datagrams. Connectionless: each datagram is independent of all others. Unreliable: there is no guarantee that datagrams are delivered correctly or at all.
Netprog 2002 TCP/IP
9.1:Introduction
Internet
Various Access networks have different operational parameters like bit rate, frame format, max frame size used. The routing and forwarding operations performed at gateway are done at the network layer
Packets serve same purpose in internet as frames on LAN Routers (or gateways) forward packets between physical networks Packets have a uniform, hardware-independent format
Includes header and data Why are these virtual? Because we would like a packet to be capable of crossing multiple networks, where networks could use different types of technologies (e.g. Token Ring, Ethernet)
Virtual Packets
The virtual packet is implemented by encapsulating it in hardware frames for delivery across each physical network
Ensures universal format across heterogenous networks
IP address
IP in each host has a unique Internet wide address assigned to it ,it is known as IP address It has 2 parts: Netid- allocated by Internet Network Information Center(InterNIC) Hostid
Protocols Used
ARP(Address Resolution Protocol)- Obtaining of Physical address from logical address RARP(Reverse Address Resolution Protocol) OSPF(Open Shortest Path First) ICMP(Internet Control Message Protocol) IGMP(Internet Group Management Protocol)
datagram Includes header area and data area Datagrams can have different sizes
Forwarding Datagrams
The header contains all the information needed to deliver a datagram to a destination computer
Destination address Source address Identifier Other delivery information
Routers examine the header of each datagram and forwards the datagram along a path to the destination
Use routing table to compute next hop Update routing tables using algorithms
Link state, distance vector, manually
9.2:IP datagrams
IPv4 =>IP version 4
(1)
Type of Service
Specify treatment of data unit during transmission through networks Ignored by many routers
Identifier
Uniquely identifies PDU for a particular sender/receiver Needed for re-assembly and error reporting Send only; i.e. in sending a data packet, not used for Deliver or ACK mode Fragmentation dropped in IP6
Flags (3 bits)
First: Is this data fragmented? Second: Are we allowed to fragment the data?
If not, may not be possible to deliver
Parameters (2)
Time to live
Prevent datagram from traveling forever by decrementing each hop
Header length
In groups of 4 bytes
Total length
In bytes, includes header and data
Type of Service
Might be useful to differentiate traffic, e.g. ICMP vs. data, or real-time data vs. non-real time Precedence
8 levels
Reliability
Normal or high
Delay
Normal or low
Throughput
Normal or high
Type of Service
Might be useful to differentiate traffic, e.g. ICMP vs. data, or real-time data vs. non-real time Precedence
8 levels
Reliability
Normal or high
Delay
Normal or low
Throughput
Normal or high
Meant to be used rarely. Way to extend the IP protocol with a variable number of options. Dropped in IPv6.
Security Source routing Loose Source routing Route recording Stream identification Time stamping
Options
Time count
Need to know how long since last router
Data Field
Carries user data from next layer up
Likely UDP/TCP packet
Integer multiple of 8 bits long (octet) Max length of datagram (header plus data) 65,535 octets
IP address
An IP address is an address used to uniquely identify a device on an IP network. The address is made up of 32 binary bits which can be divisible into a network portion and host portion with the help of a subnet mask. The 32 binary bits are broken into four octets (1 octet = 8 bits). Each octet is converted to decimal and separated by a period (dot). For this reason, an IP address is said to be expressed in dotted decimal format (for example, 172.16.81.100). The value in each octet ranges from 0 to 255 decimal, or 00000000 - 11111111 binary.
9.4:IP address
Address class
Finish address
A
B C D E
0xxx
10xx 110x 1110 1111
0.0.0.0
128.0.0.0 192.0.0.0 224.0.0.0 240.0.0.0
126.255.255.255
191.255.255.255 223.255.255.255 239.255.255.255 255.255.255.255
There are 5 different address classes. You can determine which class any IP address is in by examining the first 4 bits of the IP address. Class A addresses begin with 0xxx, or 1 to 126 decimal. Class B addresses begin with 10xx, or 128 to 191 decimal. Class C addresses begin with 110x, or 192 to 223 decimal. Class D addresses begin with 1110, or 224 to 239 decimal. Class E addresses begin with 1111, or 240 to 254 decimal.
Addresses beginning with 01111111, or 127 decimal, are reserved for loopback and for internal testing on a local machine. [You can test this: you should always be able to ping 127.0.0.1, which points to yourself] Class D addresses are reserved for multicasting. Class E addresses are reserved for future use. They should not be used for host addresses.
An address with a hostid of all 0s- Default Network - The IP address of 0.0.0.0 is used for the default network An address with a netid of all 0s implies the same network as the source network/netid An address of all 1s means broadcast the packet over the source network An address with a hostid of all 1s means broadcast the packet over the destination network in the netid part A class A address with a netid of all 1s is used for test purposes within the protocol stack of the source host.It is loopback address
RESERVED IP ADDRESSES
Network address of all ones Interpreted to mean 'all networks'
Network 127
Reserved for loop back tests. Designates the local node and allows that node to send a test packet to itself without generating network traffic.
Address Network address of all zeros Function Interpreted to mean 'this network'
Interpreted to mean 'all nodes' on the specified network, for example, 128.2.255.255 means 'all nodes' on network 128.2 (Class B address)
Broadcast to all nodes on the current network: (same as 255.255.255.255) sometimes called an 'all ones broadcast'
Network Mask
A network mask helps you know which portion of the address identifies the network and which portion of the address identifies the node. Class A, B, and C networks have default masks, also known as natural masks, as shown here: Class A: 255.0.0.0 Class B: 255.255.0.0 Class C: 255.255.255.0
Network Mask
An IP address on a Class A network that has not been subnetted would have an address/mask pair similar to: 8.20.15.1 /255.0.0.0. To see how the mask helps you identify the network and node parts of the address, convert the address and mask to binary numbers. 8.20.15.1 = 00001000.00010100.00001111.00000001 255.0.0.0 = 11111111.00000000.00000000.00000000 Once you have the address and the mask represented in binary, then identifying the network and host ID is easier. Any address bits which have corresponding mask bits set to 1 represent the network ID. Any address bits that have corresponding mask bits set to 0 represent the node ID.
Default subnet masks: Class A 255.0.0.0 11111111.00000000.00000000.00000000 Class B 255.255.0.0 11111111.11111111.00000000.00000000 Class C 255.255.255.0 11111111.11111111.11111111.00000000
Understanding Subnetting
Subnetting allows you to create multiple logical networks that exist within a single Class A, B, or C network. If you do not subnet, you are only able to use one network from your Class A, B, or C network, which is unrealistic. Each data link on a network must have a unique network ID, with every node on that link being a member of the same network. If you break a major network (Class A, B, or C) into smaller subnetworks, it allows you to create a network of interconnecting subnetworks. Each data link on this network would then have a unique network/subnetwork ID. Any device, or gateway, connecting n networks/subnetworks has n distinct IP addresses,
Subnetting
In order to subnet a network, extend the natural mask using some of the bits from the host ID portion of the address to create a subnetwork ID. For example, given a Class C network of 204.17.5.0 which has a natural mask of 255.255.255.0, you can create subnets in this manner: 204.17.5.0 - 11001100.00010001.00000101.00000000 255.255.255.224 11111111.11111111.11111111.11100000 By extending the mask to be 255.255.255.224, you have taken three bits (indicated by "sub") from the original host portion of the address and used them to make subnets. With these three bits, it is possible to create eight subnets. With the remaining five host ID bits, each subnet can have up to 32 host addresses, 30 of which can actually be assigned to a device since host ids of all zeros or all ones are not allowed (it is very important to remember this). So, with this in mind, these subnets have been created.
Subnetting
204.17.5.0 255.255.255.224 204.17.5.32 255.255.255.224 204.17.5.64 255.255.255.224 204.17.5.96 255.255.255.224 204.17.5.128 255.255.255.224 204.17.5.160 255.255.255.224 204.17.5.192 255.255.255.224 204.17.5.224 255.255.255.224 host address range 1 to 30 host address range 33 to 62 host address range 65 to 94 host address range 97 to 126 host address range 129 to 158 host address range 161 to 190 host address range 193 to 222 host address range 225 to 254
9.4.1:Subnets
9.5.2: RARP
ARP protocol
A knows B's IP address, wants to learn physical address of B A broadcasts ARP query pkt, containing B's IP address
soft state: information that times out (goes away) unless refreshed
5: DataLink Layer 5a-35
Associated with each ARP is a routing table called ARP Cache Contains list of IP/MAC address-pairs of the hosts If ARP just resolved an IP address, chances are a few moments later someone is going to ask to resolve the same IP address When ARP returns a MAC address, it is placed in a cache. When the next request comes in for the same IP address, look first in TCP/IP Protocol Suite 36 the cache
R B
5: DataLink Layer
5a-37
ARP packet
Hardware Type - Ethernet is type 1 Protocol TypeIPv4=x0800 Hardware Length:length of Ethernet Address (6) Protocol Length:length of IPv4 address (4)
Address Masks To identify destination network, apply address mask to destination address and compare to network address in routing table Can use Boolean AND if ((Mask[i] & D) == Dest[i]) forward to NextHop[i] Consider 128.1.15.26:
Forwarding IP Packets
Destination address in IP datagram is always ultimate destination Router looks up next-hop address and forwards datagram Network interface layer takes two parameters:
IP datagram Next-hop address
Frame size different in different LANS. IP address: netid, hostid. Internet network information center(InterNIC). MTU => maximum transmission unit Fragments. ARP:address resolution protocol OSPF:open shortest path first ICMP:internet control message protocol IGMP:internet group management protocol
IP Datagrams
IP provides connectionless, unreliable delivery of IP datagrams. Connectionless: each datagram is independent of all others. Unreliable: there is no guarantee that datagrams are delivered correctly or at all.
Netprog 2002 TCP/IP
IP Addresses
IP addresses are not the same as the underlying datalink (MAC) addresses.
Why ?
Netprog 2002 TCP/IP
IP Addresses
IP is a network layer - it must be capable of providing communication between hosts on different kinds of networks (different data-link implementations). The address must include information about what network the receiving host is on. This makes routing feasible.
Netprog 2002 TCP/IP
110
1110
8 bits
Netprog 2002 TCP/IP
HostID
Multicast Group ID
8 bits 8 bits 8 bits
Class A 128 possible network IDs over 4 million host IDs per network ID
Class B 16K possible network IDs 64K host IDs per network ID Class C over 2 million possible network IDs about 256 host IDs per network ID
IP Addresses
IP Addresses are usually shown in dotted decimal notation: 1.2.3.4 00000001 00000010 00000011 00000100 cs.rpi.edu is 128.213.1.1
10000000 11010101 00000001 00000001
reassembly
IP Fragmentation
Data length
Length of user data in octets
Offset
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
Fragmenting Fragments
A fragment may encounter a subsequent network with even smaller MTU
Router fragments the fragment to fit Resulting (sub)fragments look just like original fragments (except for size) No need to reassemble hierarchically; (sub)fragments include position in original datagram