DHCP
DHCP
Chapter 16
Host Configuration:
BOOTP and DHCP
Objectives
Know the types of information required by a system on boot-up
Know how BOOTP operates
Know how DHCP operates
Understand the differences between BOOTP and DHCP
Understand the DHCP transition state diagram
TCP/IP Protocol Suite
The
The
The
The
Port number
Destination IP address
Source IP address
TCP/IP Protocol Suite
16.2 DHCP
The Dynamic Host Configuration Protocol (DHCP) provides static and
dynamic address allocation that can be manual or automatic.
Dynamic address means the pair of IP address and physical address can b
dynamically changed.
Physical address is fixed for a device.
Why do we need DHCP?
Not enough IP address in a network.
Users mobility.
Address allocation
There are two methods to allocate IP address for DHCP: static and dynamic.
Static address allocation in DHCP just likes BOOTP. A DHCP server has a
database that statically binds physical addresses to IP addresses.
In dynamic address allocation, DHCP has two databases. The static database
stores the pair of IP address and physical address.
The other stores a pool of available IP addresses.
When a client sends a request to a DHCP server, the server first checks its st
database, if there is an entry for the client in the database, the permanent IP
address is sent back. Otherwise, the server selects an available IP address an
assign to the client.
10
DHCP packet
11
12
Chapter 17
Domain Name
System: DNS
Objectives
Understand how the DNS is organized
Know the domains in the DNS
Know how a name or address is resolved
13
14
15
16
17
PQDN
www.comp.polyu.edu.hk.
www.comp.polyu.hk
www.yahoo.com.
www
www.mit.edu.
www.polyu.edu.hk
18
Domains
A domain is a subtree of the domain name space. The name of the
domain is the domain name of the node at the top of the subtree.
19
17.3 DISTRIBUTION OF
Distributed NAME SPACE
The information contained in the domain name space is distributed
among many computers called DNS servers.
20
A root server is a server whose zone consists of the whole tree, the root server
usually does not store any information about domains but delegates its authority
to other servers.
A primary server is a server that stores a file about the zone for which it is an authorit
A secondary server is a server that transfers the complete information about a zone f
another server and store the file on its local disk.
A primary server loads all information
from the disk file; the secondary server
loads all information from the primary
server. When the secondary downloads
information from the primary server, it
is called zone transfer.
21
22
Generic domains
23
24
Country domains
Country domain section users use two-character country abbreviations
(e.g., hk for Hong Kong).
Second-labels can be organizational, or they can be more specific, national
designations.
25
Inverse domain
26
17.5 RESOLUTION
Mapping a name to an address or an address to a name is called nameaddress resolution.
DNS is designed as a client-server application. A host that needs to map an
address to a name or a name to an address calls a DNS client called a
resolver.
Three methods: recursive resolution, iterative resolution and cache.
Cache: when a server asks a mapping from another server and receives the
responds, it stores this information in its cache memory before sending to
the client. If the same or another client asks for the same mapping, it can
check its cache memory and resolve the problem.
27
Recursive resolution
The client (resolver) can ask for a recursive answer from a name serve
This means that the resolver expects the server to supply the final an
If the server is the authority for the domain name, it checks its databa
and responds. If the server is not the authority, it sends the request to
another server and waits for the response.
mcgraw.com
28
Iterative resolution
If the client does not ask for a recursive answer, the mapping can be
done iteratively. If the server is an authority for the name, it sends th
answer. If it is not, it returns the IP address of the server it thinks can
resolve the query
mcgraw.com
29
DNS messages
30
31
17.10 ENCAPSULATION
DNS uses UDP as the transport protocol when the size of the response
message is less than 512 bytes. If the size of the response message is
more than 512 bytes, a TCP connection (port 53) is used.
32
Chapter 20
Electronic Mail:
SMTP, POP, and IMAP
Objectives
Understand four configurations of email architecture
Understand the functions and formats of a user agent
Understand MIME and its capabilities and data types
Understand the functions and commands of an MTA
Understand the function of POP3 and IMAP4
TCP/IP Protocol Suite
33
The sender and the receiver of the email are users (or application programs
are in the same system. The administrator creates one mail box for each us
where the received message are stored. A mail box is a part of hard drive, a
special file with permission restrictions. Only the own can access to it. The p
running for receiving or sending email is called user agent (UA).
When the sender and the receiver of an email are on the same syst
we need only two UAs.
34
Scenario-II
The sender and the receiver of an email are users (or application pro
on the two different systems. We need two UAs and one message tr
agent (MTA). MTA is responsible for email delivery from one system
the other.
35
Scenario-III
36
Scenario-IV
The sender and receiver of an email are users who are connected to t
servers by a LAN or WAN. In this case, we need a message access ag
To store received emails. Hence, we need two pairs of MTAs and a pai
of MAAs. This is the most common situation today.
push
pull
37
Position of SMTP
TCP/IP Protocol Suite
38
Command format
39
Connection establishment
After a client made a TCP connection to the well-known port 25, the
Servers starts the connection phase which involves three steps as b
40
Connection termination
41
Example 1
Let us see how we can directly use SMTP to send an email and simulate the
commands and responses we described in this section. We use TELNET to
log into port 25 (the well-known port for SMTP). We then use the
commands directly to send an email. In this example,
[email protected] is sending an email to himself. The first few lines
show TELNET trying to connect to the adelphia mail server.
$ telnet mail.adelphia.net 25
Trying 68.168.78.100...
Connected to mail.adelphia.net (68.168.78.100).
After connection, we can type the SMTP commands and then receive the
responses as shown below. We have shown the commands in black and the
responses in color. Note that we have added for clarification some comment
lines, designated by the = sign. These lines are not part of the email
procedure.
TCP/IP Protocol Suite
42
Example 1
(Continued)
43
Example 1
(Continued)
44
45
Figure 20.20
POP3
46
Chapter 21
Network Management:
SNMP
Objectives
Understand the SNMP manager and the SNMP agent
Understand the roles of SMI and MIB in network management
Be familiar with SMI object attributes and encoding methods
Know how an MIB variable is accessed
Be familiar with the SNMP PDU and format
TCP/IP Protocol Suite
47
21.1 CONCEPT
Simple network management protocol (SNMP) is a framework for
managing devices in an Internet using TCP/IP protocol suite. It defines a
manager, usually a host, that controls and monitors a set of agents, usually
routers. SNMP is an application layer protocol in which a few manager
stations control a set of agents.
A management station, called a manager, is a host that runs the SNMP client program.
A managed station, called agent, is a router (or host) that runs the SNMP server
program. Management is achieved through simple information between a manager and
an agent.
48
49
50
Figure 21.3
Management overview
Manager
Agent
TCP/IP Protocol Suite
51
21.3 SMI
SMI is a component used in network management. It names objects,
defines the type of data that can be stored in an object, and shows how
data can be encoded for transmission over the network
Its functions are: (1) To name objects;
(2) To define the type of data that can be stored in an object;
(3) To show how to encode data for transmission over the network.
SMI is a guideline for SNMP. It emphasizes three object attributes: name, data type,
and encoding method.
52
Name:
Object identifier
53
Data type
SMI uses fundamental Abstract Syntax Notation 1 (ASN.1) definitions and adds
some new definitions. It has two data types: simple and structured.
Simple data types
54
55
Encoding format
SMI uses Basic Encoding Rules (BER) to encode data to be transmitted over
network. BER specifies that each piece of data be encoded in triplet format:
tag, length, and value.
The tag is a 1-byte field that defines the type of data. It composed of three subfields:
class (2 bits), format (1 bit), and number (5 bits). The class subfield defines the scope of
the data. Four classes: universal (00), application-wide (01), context-specific (10), and
private (11). The format subfield indicates if the data is simple (0) or structured (1).
The number subfield divides simple or structured data into subgroups.
The length field is 1 or more bytes.
The value field codes the value of the data according to the rules defined in BER.
TCP/IP Protocol Suite
56
57
Length format
The length field is 1 or more bytes.
If it is 1 byte, the most significant bit must be 0, The other 7 bits defines the length
of the data.
If it is more than 1 byte, the most significant bit of the first byte must be 1. The
other 7 bits of the first byte define the number of bytes needed to define the length.
58
Example 1
59
Example 2
60
Example 3
61
Example 4
62
21.4 MIB
MIB is a component used in network management. Each agent has its own
MIB, a collection of all the objects that the manager can manage.
The objects in MIB2 (version 2) are classified as different groups: system,
interface, address translation, ip, icmp, tcp, udp, egp, transmission, and
snmp. These groups are under in the object identifier tree.
63
Descriptions on groups
sys: this object (system) defines general information about the node (system),
such as the name, location, and lifetime.
if:
this object (interface) defines information about all the interfaces of the node
including interface number, physical address, and IP address.
at:
this object (address translation) defines the information about ARP table.
ip:
this object defines information related to IP, such as routing table and IP address.
icmp: this object defines information related to ICMP, such as the number of packets sent
and received and total errors created.
tcp: this object defines general information related to TCP, such as the connection table,
time-out value, number of ports, and number of packets sent and received.
udp: this object defines general information related to UDP, such as the number of ports
and number of packets sent and received.
snmp: this object defines general information related to SNMP itself.
64
1.3.6.1.2.1.7.1
1.3.6.1.2.1.7.5.1.1
65
We need index
to access the
Table, how to
give the index?
66
67
21.5 SNMP
SNMP is an application program that allows 1) a manager to retrieve the
value of an object defined in an agent; 2) a manager to store a value in an
object defined in an agent; and 3) an agent to send an alarm message about
an abnormal situation to the manager
SNMPv3 defines 8 types of packets (or payload data units (PDU)):
GetRequest: from the manager to the agent to retrieve the value of a variable or
a set variable.
GetNextRequest: from the manager to the agent to retrieve the value of a variable.
GetBulkRequest: from a manager to an agent to get a bulk of variables.
SetRequest: from the manager to the agent to set a value in a variable.
Response: from an agent to a manger in response to GetRequest or GetNextRequest.
Trap: from an agent to a manager to report an event.
InformRequest: from one manager to another remote manager to get the value of
some variables from agents under control of remote manager.
Report: designed to report some types of errors between managers.
68
SNMP PDUs
69
Types of errors
70
21.6 MESSAGES
A message in SNMP
is made of four
elements:
version,
header,
security
parameters, and data
(which includes the
encoded PDU).
71
72
73
Summary
1.
BOOTP
2.
DHCP.
3.
DNS
Domain Name, Zone, FQDN, PQDN
Root, primary, second primary servers
Generic, country, inverse domains
Recursive, iterative and cache solutions
74
Summary
4. Email
Email architecture
SMTP, POP3, IMAP4
5. SNMP, SMI, MIB
Name, type, encoding, message
75
Excises
1.
Why does a newly added host need to know the IP address of a router?
2. Why does a newly added host need to know the IP address of a name
server?
76
Excises-Cont.
3. Show the address solution process for the client ask for address of www.irwin.com
using (a) recursive (b) iterative methods.
77
Excises
4. A non-ASCII message of 1,000 bytes is encoded using base64. How many bytes are
in the encoded message?
5. Encoding the following message in base64
01001011 00110101 11001110
6. Why is a connection establishment for mail transfer needed if TCP has already
established a connection?
7. Show the encoding for 1456.
8. Show the encoding of Hello World.
9. Show the arbitrary OCTET STRING of length 1,000.
10. Show how the following record is encoded.
INTEGER
OCTET STRING
2345
COMPUTER
IP Address
185.32.1.5
78
Answers:
1.
2.
79
Answers-cont.II:
3. (a) recursive
38
1
10
80
Answers:
4. Each byte in base64 1000x8/6=1336 bytes in the encoded message.
5. Original:
01001011 00110101 11001110
Group by 6: 010010 110011 010111 001110
Base 64:
18 51
23
14
ASCII:
S
z
X
O
Converted bit pattern: 01001011 00110101 11001110
6. Connection establishment is needed for mail transfer because the messages sent
relay necessary information about the communication to the client and server
software, not just whether the computers have a connection via TCP.
7. INTEGER tag: 02
length: 04
value: 00 00 05 B0
-----------------------------------Answer: 02 04 00 00 05 B0
81
Answers-cont:
8.
9.
10. 30 16
sequence, length
02 04 00 00 09 29 INTEGER, length, value (2345)
04 08 43 4F 4D 50 55 54 45 52 OCTET STRING, length, value (COMPUTER)
40 04 B9 20 01 05 IP address, length, value (185.32.1.5)
TCP/IP Protocol Suite
82