Lecture 3 Internet Print
Lecture 3 Internet Print
Flow of Information
SOURCE DESTINATION
Application Application
socket API TCP/UDP
NETWORK
TCP/UDP
socket API
ELEMENT
API = IP IP IP
Application H-to-N =
H-to-N H-to-N H-to-N
Programmin Host-to-
g Network
Interface
Data Communications and Computer Networks
IP offers a “best-effort” datagram service
the Internet was originally intended for robust transfer of computer-to-
computer data over long distances
best-effort service appropriate for data transfers
no real-time requirements
end-points can adapt to network conditions, if they want/need to
connectionless packet-switching was preferred to circuit-switching
no set-up delay
no blocking (fire-and-forget, forward-if-possible, deliver-as-received)
however, there is no guarantee that any data reaches the destination
flexibility in transmission bit-rates
in contrast with circuit-switching, which is usually tied to a few pre-determined
bit-rates
no “path” ⇒ more reliable (route around problems)
more efficient use of network resources when traffic is bursty
economics: transmission became more expensive than switching in late 1960s
Datalink Frames
have a Trailer
also
(not shown here)
Internet Protocol
(IP)
Data Communications and Computer Networks
Transmission Control Protocol/Internet Protocol (TCP/IP)
Features of TCP/IP
1) Industry Standard Protocol.
2) Used by almost all operating systems
3) Internet standard protocol.
4) Used IP address for identifying host on network.
5) The current version is IPv4.
6) Robust and Routable protocol.
7) More Flexible and configuration then other protocol.
8.3.1 Internet Protocol (IP) - IPv4 Header
all fragments of a Fragmentation of a datagram
given datagram is needed when an intermediate
have the same network has a max frame size
Identification value too small to carry the datagram
IP Addressing
One of the most important topics in any discussion of TCP/IP is IP addressing. An IP address
is a numeric identifier assigned to each machine on an IP network. It designates the specific location of a
device on the network.
An IP address is a software address, not a hardware address. The latter is hard-coded on
a network interface card (NIC) and used for finding hosts on a local network. IP addressing was designed to
allow hosts on one network to communicate with a host on a different network regardless of the type of
LANs the hosts are participating in.
IP Terminology
In this section several important terms that are vital to your understanding of the Internet
Protocol. Here are a few to get you started:
Byte A byte is 7 or 8 bits, depending on whether parity is used. For this course, always
assume that a byte is 8 bits.
Octet An octet, made up of 8 bits, is just an ordinary 8-bit binary number. In this course,
the terms byte and octet are completely interchangeable.
IP Addressing IP address is a 32-bit binary value divided into 4 octels of 8-bit
each. i.e 00000000.00000000.00000000.00000000. The range of IP address in
binary is 00000000.00000000.00000000.00000000 to
11111111.11111111.11111111.11111111. This is the Binary notation
Examples of IP address
10.12.45.54
192.168.10.5
208.144.0.2
An IP address consist of two parts, one is Network ID and other is Host ID.
Network ID should be same for all the PCs in a same network segment and Host
ID should be unique for each PC. If two PC is having different network ID then
they will not be able to communicate with each other directly. So network ID
should be same for all the PC's in same segment.
Classful Addressing
IPv4 addressing, at its inception, used the concept of classes. This architecture is called
classful addressing. Although this scheme is becoming obsolete, we briefly discuss it here to
show the rationale behind classless addressing. In classful addressing, the address space is
divided into five classes: A, B, C, D, and E. Each class occupies some part ofthe address space
To ensure efficient routing, Internet designers defined a mandate for the leading-bits
section of the address for each different network class. For example, since a router
knows that a Class A network address always starts with a 0, the router might be able
to speed a packet on its
way after reading only the first bit of its address. This is where the address schemes define
the difference between a Class A, a Class B, and a Class C address.
The first bit of the first byte in a Class A network address must always be off, or 0.
Consider the following network address:
0xxxxxxx
If we turn the other 7 bits all off and then turn them all on, we’ll find the Class A range of
network addresses:
00000000 = 0
01111111 = 127
This means a Class A address must be between 0 and 127 in the first byte, inclusive.
Network 127.0.0.1 is reserved for loopback tests. Designates the local node and allows that
node to send a test packet to itself without generating network traffic.
Network Address Range: Class B
The first bit of the first byte must always be turned on but the second bit must always be
turned off. If you turn the other 6 bits all off and then all on, you will find the range for a
Class B network:
10000000 = 128
10111111 = 191
This means a Class A address must be between from 128 to 191 in the first byte, inclusive.
Network Address Range: Class C
The first 2 bits of the first octet are always turned on, but the third bit can never be on.
Following the same process as the previous classes, convert from binary to decimal to find
the range. Here’s the range for a Class C network:
11000000 = 192
11011111 = 223
So, if you see an IP address that starts at 192 and goes to 223, you’ll know it is a Class C
IP address.
Network Address Ranges: Classes D and E
The addresses between 224 to 255 are reserved for Class D and E networks. Class D (224–
239) is used for multicast addresses and Class E (240–255) for scientific purposes.
For this course we don’t need to know them.
There are two types of IPv4 addresses:
Private IP address
Public IP address
Public IP Addresses
These are IP addresses that are routable on the internet.
Private IP Addresses
These are IP addresses that can be used on a private network, but they’re not routable through
the internet.
This is designed for the purpose of creating a measure of well-needed security, but it also
conveniently saves valuable IP address space. If every host on every network had to have real
routable IP addresses, we would have run out of IP addresses. But by using private IP
addresses ISPs and home users only need a relatively tiny group of bona fide IP addresses to
connect their networks to the Internet. This is economical because they can use private IP
addresses on their inside networks and get along just fine.
To accomplish this task, the ISP and the corporation, the end user, no matter who they are
need to use something called Network Address Translation (NAT), which basically takes a private IP address
and converts it for use on the Internet.
The reserved private addresses are listed in table below.
Private IP address Private IP address are called as non-routable IP
because they are not used in Internet. These IP address range are
used for Private network so as to avoid conflicts in Internet.
Types of Address
Unicast = When a packet to send to a single host eg. host 10.0.0.1
is sending a packet to 10.0.0.2
All 0’s
This host
Broadcast on the
All 1’s
local network
Broadcast on remote
Netid All 1’s
network specified by
Netid
refers to the network
Netid All 0’s
with specified Netid
IP packets with loopback addresses are processed by the machine which generated
them as if they were incoming packets (useful for debugging network software)
if a host doesn’t know its own IP address (e.g. diskless workstation being
booted), it uses Reverse ARP
host broadcasts its physical address and asks for corresponding IP
address; RARP server replies
could give organisations which are large enough for a Class B address a
number of Class C addresses instead
then every Internet backbone router would need an entry in its
routing table for each of these Class C network numbers
CIDR: medium-large organisations get contiguous blocks of Class C
addresses (in powers of 2)
example: company needs 8,000 IP addresses ⇒ gets 32 contiguous blocks of
Class C addresses ≡ 8,192 addresses
e.g. if given Class C network numbers 192.4.0 – 192.4.31, then first 19
bits of all addresses in company’s networks are the same (19-bit network
prefix):
11000000 00000100 000 ⇒ first 19 bits of network mask are
1, rest
are 0
this company’s IP addresses are now written (e.g.) 192.4.19.252/19
same idea is now applied to all addresses, not just Class C addresses
subnetting: share one network IP address among multiple physical networks
CIDR: collapse multiple adjacent IP addresses onto one network prefix
IP Subnetting
• IP address is composed of a Netid part and a Hostid part ⇒ 2-level hierarchy
• sometimes a 2-level hierarchy is insufficient for an organisation’s needs:
Class B network
• a solution:
subnetting
Because WAN links are considerably slower and more expensive than LAN links, a single large network that spans long distances can
create problems in every area previously listed. Connecting multiple smaller networks makes the system more efficient.
number of subnets, valid hosts, and broadcast addresses of a subnet that the mask provides,
How many subnets? 2^x = number of subnets. x is the number of masked bits, or the 1s. For example, in 11000000, the
number of 1s gives us 2^2 subnets. In this example, there are 4 subnets.
How many hosts per subnet? 2^y – 2 = number of hosts per subnet. y is the number of unmasked bits, or the 0s. For example, in
11000000, the number of 0s gives us 2^6 – 2 hosts. In this example, there are 62 hosts per subnet. You need to subtract 2 for the
subnet address and the broadcast address, which are not valid hosts.
What are the valid subnets? 256 – subnet mask = block size, or increment number. An example would be 256 – 192 = 64. The
block size of a 192 mask is always 64. Start
counting at zero in blocks of 64 until you reach the subnet mask value and these are your subnets. 0, 64, 128, 192.
What’s the broadcast address for each subnet? Now here’s the really easy part. Since we counted our subnets in
the last section
as 0, 64, 128, and 192, the broadcast address is always the number right before the next subnet.
For example, the 0 subnet has a broadcast address of 63 because the next subnet is 64. The 64 subnet has a
broadcast address of 127 because the next subnet is 128. And so on. And remember, the broadcast address of the
last subnet is always 255.
For the subnet address scheme to work, every machine on the network must know which part of the host address
will be used as the subnet address. This is accomplished by assigning a subnet mask to each machine. A subnet
mask is a 32-bit value that allows the recipient of IP packets to distinguish the network ID portion of the IP address
from the host ID portion of the IP address.
The network administrator creates a 32-bit subnet mask composed of 1s and 0s. The 1s in the subnet mask represent
the positions that refer to the network or subnet addresses. Not all networks need subnets, meaning they use the
default subnet mask. This is basically the same as saying that a network doesn’t have a subnet address.The table
shows the default subnet masks for Classes A, B, and C. These default masks cannot change.
In other words, you can’t make a Class B subnet mask read 255.0.0.0. If you try, the host will read that address as invalid and usually
won’t even let you type it in. For a Class A network, you can’t change the first byte in a subnet mask; it must read 255.0.0.0 at a
minimum. Similarly, you cannot assign 255.255.255.255, as this is all 1s, a broadcast address. A Class B address must start with
255.255.0.0, and a Class C has to start with 255.255.255.0.
In a Class C address, only 8 bits are available for defining the hosts. Remember that subnet bits start at the left and go to the right,
without skipping bits. This means that the only Class C subnet masks can be the following:
We can’t use a /31 or /32 because we have to have at least 2 host bits for assigning IP addresses to hosts.
Example #1: 255.255.255.128 (/25)
Since 128 is 10000000 in binary, there is only 1 bit for subnetting and 7 bits for hosts. We’re going to subnet the Class C network
address 192.168.10.0.
192.168.10.0 = Network address
255.255.255.128
= Subnet mask
Now, let’s answer the big five:
How many subnets? Since 128 is 1 bit on (10000000), the answer would be 21 = 2.
How many hosts per subnet? We have 7 host bits off (10000000), so the equation would be 27 – 2 = 126 hosts.
What are the valid subnets? 256 – 128 = 128. Remember, we’ll start at zero and count in our block size, so our subnets are 0, 128.
What’s the broadcast address for each subnet? The number right before the value ofthe next subnet is all host bits turned on and
equals the broadcast address. For the zero subnet, the next subnet is 128, so the broadcast of the 0 subnet is 127.
What are the valid hosts? These are the numbers between the subnet and broadcast address. The easiest way to find the hosts is
to write out the subnet address and the broadcast address. This way, the valid hosts are obvious. The following table shows the
0 and 128 subnets, the valid host ranges of each, and the broadcast address of both subnets:
Example #2: 255.255.255.192 (/26)
In this second example, we’re going to subnet the network address 192.168.10.0 using the
subnet mask 255.255.255.192.
192.168.10.0 = Network address
255.255.255.192 = Subnet mask
Now, let’s answer the big five:
How many subnets? Since 192 is 2 bits on (11000000), the answer would be 22 = 4
subnets.
How many hosts per subnet? We have 6 host bits off (11000000), so the equation
would be 26 – 2 = 62 hosts.
What are the valid subnets? 256 – 192 = 64. Remember, we start at zero and count in
our block size, so our subnets are 0, 64, 128, and 192.
What’s the broadcast address for each subnet? The number right before the value of
the next subnet is all host bits turned on and equals the broadcast address. For the zero subnet, the next
subnet is 64, so the broadcast address for the zero subnet is 63.
What are the valid hosts? These are the numbers between the subnet and broadcast
address. The easiest way to find the hosts is to write out the subnet address and the
broadcast address. This way, the valid hosts are obvious. The following table shows
the 0, 64, 128, and 192 subnets, the valid host ranges of each, and the broadcast
address of each subnet:
Subnetting Class B Addresses
With Class B addresses, we have a lot more possible subnet masks than we do with a Class C
network address:
We know the Class B network address has 16 bits available for host addressing. This means we can use up to 14 bits for
subnetting (because we have to leave at least 2 bits for host addressing). Using a /16 means you are not subnetting with
class B, but it is a mask you can use.
This section will give you an opportunity to practice subnetting Class B addresses. Again, I
have to mention that this is the same as subnetting with Class C, except we start in the third octet with the exact same
numbers.
Example #1: 255.255.128.0 (/17)
172.16.0.0 = Network address
255.255.128.0 = Subnet mask
Subnets? 21 = 2 (same as Class C).
Hosts? 215 – 2 = 32,766 (7 bits in the third octet, and 8 in the fourth).
Valid subnets? 256 – 128 = 128. 0, 128. Remember that subnetting is performed in
the third octet, so the subnet numbers are really 0.0 and 128.0, as shown in the next
table. These are the exact numbers we used with Class C; we use them in the third
octet and add a 0 in the fourth octet for the network address.
Broadcast address for each subnet?
Valid hosts?
The following table shows the two subnets available, the valid host range, and the broadcast
address of each:
Valid hosts?
The following table shows the four subnets available, the valid host range, and the broadcast
address of each:
255.255.240.0 gives us 12 bits of subnetting and leaves us 12 bits for host addressing.
Subnets? 212 = 4096.
Hosts? 212 – 2 = 4094.
Valid subnets? What is your interesting octet? 256 – 240 = 16. The subnets in the
second octet are a block size of 1 and the subnets in the third octet are 0, 16, 32, etc.
Broadcast address for each subnet?
Valid hosts?
The following table shows some examples of the host ranges the first three and the last subnets:
8.3.2 IPv6: Next Generation IP
in early 90s, IETF held an open design process to design
the next version of IP: IPv6
Broadcast Networks
MAC and LLC
Sublayers
The 802.X
standard
Ethernet
Token Ring
Token Bus
FDDI
Wireless LANs
Gateway INTERNET
School of Nursing
Backbone Network
VAX
logical addresses
noise burst generated by node B to warn all other nodes about collision
• this shows why there is a minimum frame length in CSMA/CD systems: all
frames must take more than 2τ to transmit (“pad” information field, if
necessary)
Data Communications and Computer Networks
Datalink layer: CSMA/CD / Ethernet Frame
line
card
number of bytes
Data Communications and Computer Networks
Data Link Layer: Wireless LANs
Disadvantages
Equipment still quite expensive
Security
Errors will be more frequent
Lower Bit Rates
A B C D
Range of A
RTS
C A CTS B D
E
Range of B
A wishes to transmit to B
C, B and E hear the RTS from A
A, E and D hear the CTS from
B
A starts to transmit
D knows not to, even though it cannot hear
A
Actually, C can transmit, as B will not hear it. Must only wait for
CTS
Collisions can occur between RTS frames, but not as
serious
MACAW (MACA for Wireless adds
Acknowledgements)
CSMA is used to reduce RTS collisions
Upper Layers
MAC
sublay
er
802.11 802.11 802.11 802.11a 802.11b 802.11g
Infrared FHSS DSSS OFDM HR-DSSS OFDM
Signal Wire
Reference Wire