You are on page 1of 37

Lecture On

IP Address and
IP Protocol

Ashis Talukder, MIS, DU. 1


Transmission Medium

• Definition
• Guided:
• Twisted Pair
• Coaxial Cable,
• Optical Fiber
• Unguided:
• IR
• Spread Spectrum
• Microwave
• Bluetooth

Ashis Talukder, MIS, DU. 2


Today’s Class

Ashis Talukder, MIS, DU. 3


IP Address & IP Protocol:
• Introduction: IP address
• Subnet Mask
• Classes of IP Address: A, B, C, D, E
• IP Header format
• ICMP

Ashis Talukder, MIS, DU. 4


IP Address

• Number assigned to hosts in network (internet) to identify the host


uniquely
• An IP (v4) address is a 32-bit sequence of 1s and 0s.
• To make the IP address easier to use, the address is usually written as
four decimal numbers separated by periods.
• This way of writing the address is called the dotted decimal format.

Ashis Talukder, MIS, DU. 5


IP Address

Ashis Talukder, MIS, DU. 6


IP Address

• An IP address that has binary 0s in all host bit


positions is reserved for the network address.
• Example: 192.168.3.0/24

• An IP address that has binary 1s in all host bit


positions is reserved for the broadcast address.
• Example: 192.168.3.255/24

Ashis Talukder, MIS, DU. 7


Subnets and Subnet Masks

• Each LAN assigned subnet number


• Host portion of address partitioned into subnet number and host
number
• Subnet mask indicates which bits are subnet number and which are
host number

• Bitwise logical AND of IP address and its sub-netmask gives the


network address to which the IP address belongs to.

Ashis Talukder, MIS, DU. 8


Subnet Mask

Binary Representation Dotted Decimal


IP address 11000000.11100100.00010001.00111001 192.228.17.57
Subnet mask 11111111 .11111111.11111111 .11100000 255.255.255.224
Bitwise AND of 11000000.11100100.00010001.00100000 192.228.17.32
address and mask
(resultant
network/subnet
number)

Subnet number 11000000.11100100.00010001.001 1


Host number 00000000.00000000.00000000.00011001 25

Ashis Talukder, MIS, DU. 9


Classes of IP Address

• Class A
• Class B
• Class C
• Class D (Multicast Address)
• Class E (Reserved for future use)

Ashis Talukder, MIS, DU. 10


Class A

• Prefix: 0
• Net Bit: 8
• Host Bit: 24
• Range: 0-127(1-126 usable)

Ashis Talukder, MIS, DU. 11


Class A

• No of Networks: 27 - 2
• No of Host/Net: 224 – 2
• Default Subnet Mask: 255.0.0.0
• All Allocated

Ashis Talukder, MIS, DU. 12


Class B

• Prefix: 10
• Net Bit: 16
• Host Bit: 16
• Range: 128 - 191

Ashis Talukder, MIS, DU. 13


Class B

• No of Networks: 214
• No of Host/Net: 216 – 2
• Default Subnet Mask: 255.255.0.0
• All Allocated

Ashis Talukder, MIS, DU. 14


Class C

• Prefix: 110
• Net Bit: 24
• Host Bit: 8
• Range: 192 - 223

Ashis Talukder, MIS, DU. 15


Class C

• No of Networks: 221
• No of Host/Net: 28 – 2
• Default Subnet Mask: 255. 255. 255.0
• Nearly all allocated

Ashis Talukder, MIS, DU. 16


Class D

• Prefix: 1110
• Multicast address

Ashis Talukder, MIS, DU. 17


Class E

• Prefix: 11110
• Reserved for future use

Ashis Talukder, MIS, DU. 18


IP Header

Ashis Talukder, MIS, DU. 19


Private and Public IP
• Version
• currently 4
• IP v6 - see later

• Internet header length


• in 32 bit words
• including options

• DS/ECN (was type of service)

• total length
• of datagram, in octets

Ashis Talukder, MIS, DU. 20


Private and Public IP
• Identification
• sequence number
• identify datagram uniquely with addresses / protocol

• Flags
• More bit
• Don’t fragment

• Fragmentation offset
• Time to live

• Protocol
• Next higher layer to receive data field at destination

Ashis Talukder, MIS, DU. 21


Private and Public IP
• Header checksum
• reverified and recomputed at each router
• 16 bit ones complement sum of all 16 bit words in header
• set to zero during calculation

• Source address
• Destination address

• Options
• Padding
• to fill to multiple of 32 bits long

Ashis Talukder, MIS, DU. 22


Private and Public IP
• No two machines that connect to a public network can have the same IP
address because public IP addresses are global and standardized.

• However, private networks that are not connected to the Internet may
use any host addresses, as long as each host within the private network
is unique.

• RFC 1918 sets aside three blocks of IP addresses for private, internal use.

• Connecting a network using private addresses to the Internet requires


translation of the private addresses to public addresses using Network
Address Translation (NAT).

Ashis Talukder, MIS, DU. 23


Private and Public IP

Ashis Talukder, MIS, DU. 24


ICMP
• Internet Control Message Protocol
• RFC 792 (get it and study it)
• transfer of (control) messages from routers and
hosts to hosts
• feedback about problems
• e.g. time to live expired
• encapsulated in IP datagram
• hence not reliable

Ashis Talukder, MIS, DU. 25


ICMP
• ICMP provides a means for transferring messages from routers and
other hosts to a host.

• In essence, ICMP provides feedback about problems in the


communication environment.

• Examples of its use are when a datagram cannot reach its destination,
when the router does not have the buffering capacity to forward a
datagram, and when the router can direct the station to send traffic on a
shorter route.

• In most cases, an ICMP message is sent in response to a datagram,


either by a router along the datagram's path or by the intended
destination host.

Ashis Talukder, MIS, DU. 26


ICMP
• Although ICMP is, in effect, at the same level as IP in the TCP/IP
architecture, it is a user of IP.

• An ICMP message is constructed and then passed down to IP, which


encapsulates the message with an IP header and then transmits the
resulting datagram in the usual fashion.

• Because ICMP messages are transmitted in IP datagrams, their delivery


is not guaranteed and their use cannot be considered reliable.

Ashis Talukder, MIS, DU. 27


Common ICMP Messages
• destination unreachable
• time exceeded
• parameter problem
• source quench
• redirect
• echo & echo reply
• timestamp & timestamp reply
• address mask request & reply

Ashis Talukder, MIS, DU. 28


Common ICMP Messages

Ashis Talukder, MIS, DU. 29


ICMP
• Type (8 bits):
• Specifies the type of ICMP message.
• Code (8 bits):
• Used to specify parameters of the message that can be
encoded in one or a few bits.
• Checksum (16 bits):
• Checksum of the entire ICMP message. This is the same
checksum algorithm used for IP.
• Parameters (32 bits):
• Used to specify more lengthy parameters.

Ashis Talukder, MIS, DU. 30


ICMP
• These fields are generally followed by additional information fields
that further specify the content of the message.

• In those cases in which the ICMP message refers to a prior datagram,


the information field includes the entire IP header plus the first 64 bits
of the data field of the original datagram.

• This enables the source host to match the incoming ICMP message
with the prior datagram.

Ashis Talukder, MIS, DU. 31


Common ICMP Messages
• The destination unreachable message covers a number of
contingencies. A router may return this message if it does not know how
to reach the destination network.

• A router will return a time exceeded message if the lifetime of the


datagram expires. A host will send this message if it cannot complete
reassembly within a time limit.

• A syntactic or semantic error in an IP header will cause a parameter


problem message to be returned by a router or host.

• The source quench message provides a rudimentary form of flow


control. Either a router or a destination host may send this message to a
source host, requesting that it reduce the rate at which it is sending traffic
to the destination.

Ashis Talukder, MIS, DU. 32


Common ICMP Messages
• A router sends a redirect message to a host on a directly connected
router to advise the host of a better route to a particular destination.

• The echo and echo reply messages provide a mechanism for testing that
communication is possible between entities. The recipient of an echo
message is obligated to return the message in an echo reply message. The
common “ping” utility uses these messages

• The timestamp and timestamp reply messages provide a mechanism for


sampling the delay characteristics of the internet.

• The address mask request and address mask reply messages are useful
in an environment that includes subnets, enabling a host to learn the
address mask for the LAN to which it connects.

Ashis Talukder, MIS, DU. 33


…???

Ashis Talukder, MIS, DU. 34


Next Class

Ashis Talukder, MIS, DU. 35


Transport Layer Protocols
• TCP header
• 3-way handshaking
• PAR
• Denial of service attack (DoS)
• Sequence Number
• Windowing
• Multiple Conversation
• Socket
• UDP

Ashis Talukder, MIS, DU. 36


Thank You…!!!

Ashis Talukder, MIS, DU. 37

You might also like