View
233
Download
0
Category
Preview:
Citation preview
Dr. Clincy Lecture 1
CS
8640 Cover BOOTP/DHCP
Dr. Clincy Lecture 2
CS
8640
Dynamic Mapping: ARP and RARP• ARP: maps the logical address to the physical address
(given logical, find physical)
• RARP: maps the physical address to the logical address (given physical, find logical)
• ARP/RARP use unicast & broadcast physical addresses (from earlier lectures, recall the formats of the broadcast/unicast addresses)
Dr. Clincy Lecture 3
CS
8640
Alternative Solutions to RARPAlternative Solutions to RARP
• When a diskless computer is booted, it needs more information in addition to its IP address.
• It needs to know its subnet mask, the IP address of a router, and the IP address of a name server.
• RARP cannot provide this extra information. New protocols have been developed to provide this information.
• In Chapter 16 we discuss two protocols, BOOTP and DHCP, that can be used instead of RARP.
Dr. Clincy Lecture 4
CS
8640
BOOTP• Each station connected to the Internet must know:
• It’s IP address
• It’s subnet mask
• The IP address of a router
• The IP address of a name server
• Typically, this info is stored in the computer’s config file and retrieved during boot-strap time
• What happens if a computer boots-up for the first time or if a computer is diskless ? Will need an ARP/RARP like protocol to get the needed info
• BOOTP – stands for Bootstrap Protocol – is a C/S protocol setup to provide the info above
Dr. Clincy Lecture 5
CS
8640
BOOTP packet format• Operation Code: defines the type of
BOOTP packet (request or reply)
• Hardware Type: type of LAN
• Hardware Length: physical address length
• Hop Count: max # hops a packet can travel
• Transaction ID: id used to match reply with request
• # of seconds: seconds elasped since start of boot
• Client IP address: if the client doesn’t know this, filled with zeros
• Your IP address: client address filled in by the server (for a reply message)
• Server IP address: filled by the server reply (for a reply message)
• Gateway IP address: address of router filled by the server reply
• Client hardware address: physical address of client supplied by client
• Server name: optional – filled by the server reply (for reply message)
• Boot filename: optional – filled by the server reply
• Options: can carry either network mask or default router address OR some vendor info
Dr. Clincy Lecture 6
CS
8640
BOOTP Options Field• Only used in the reply (not the request)
• When the client finish reading the message, if it encounters 99.130.83.99 (magic cookie), the next 60 bytes are options
• Option is composed of: (1) 1-byte tag, (2) a 1-byte length (length of value field) and (3) value
Option format
Do you have any ideas why the length is specified ????
Dr. Clincy Lecture 7
CS
8640
Options for BOOTP
Dr. Clincy Lecture 8
CS
8640
BOOTP operation• Recall that the BOOTP protocol has a C/S implementation
• The BOOTP server waits for a request from a client (passive open)
• Client sends a request to the server by using “this host on this network” address (recall Ch 4) – host sending to a bootstrap server when it doesn’t know it’s own IP address
• Then the server either broadcast or unicast the reply back – if the server unicast, it can’t use the ARP service because the server DOESN’T know the client’s IP address
Other
• The server doesn’t send back all of the info needed to boot-up. It sends a pathname to the client and the client can FTP the info over to it
• Sometimes a remote server is used via a router (called a relay agent) versus a local server – in this case, the router would work in between the client and remote BOOTP server
• Because UDP is used, BOOTP has to implement it’s own error control by (1) using a checksum approach and (2) by retransmitting if necessary (wait times to retransmit are random in minimizing traffic jams)
Dr. Clincy Lecture 9
CS
8640
DHCP• Although BOOTP provides more information to the client, the physical-to-
logical address mapping is static – this mapping must be pre-determined
• The Dynamic Host Configuration Protocol (DHCP) was devised to extend BOOTP
• DHCP server has 2 DBs: (1) one DB statically binds the physical and IP addresses (so it can provide the BOOTP type service), (2) a second DB contains a pool of IP addresses (making the assignment of IP addresses dynamic)
• Therefore, when a client sends a request, the DHCP server first checks its static DB and a permanent (static) IP address is returned. If the physical-to-logical relationship doesn’t exist, it then sends an un-used IP address from it’s second DB.
• The dynamic IP addresses have a time limit
Dr. Clincy Lecture 10
CS
8640
DHCP packet• The DHCP packet is very similar to the BOOTP packet except, a 1-bit flag and more
options were added
• 1-bit flag: 1st bit of the unused field: used to let the client know if the reply is broadcast or unicast – recall the potential problem with a unicast reply – the client itself could possibly NOT know it’s IP address
New options define:
• Interactions between the DHCP client and server
• Time limits on dynamically issued IP addresses
• Etc..
Dr. Clincy Lecture 11
CS
8640
DHCP transition diagram• The DHCP client transitions state to state depending on the messages
it receives or sends
The DHCP starts in an initialization state broadcasting a DHCPDISCOVER request message
• The server issues a DHCPOFFER locking in the IP address.
• The client then moves to the Selecting state and select one of the DHCPOFFERs and issue a DHCPREQUEST to the selected server and then goes to the Requesting State
• If no DHCPOFFER, the client waits and retry
• The client remains in the Requesting state until it receives a DHCPACK from the server (creating a bind between the client’s physical and IP addresses)
• The client uses the leased IP address during the Bound state – when 50% of the time expire, the client does another DHCPREQUEST for a time renewal. During this state, the client can also cancel
• During the Renewing state, if the DHCP server sends a new DHCPACK, the client starts over in the Bound state
• If no DHCPACK is received and 87.5% of the time has expired, the client goes into a Rebinding state.
• 1 of 3 events can happen in the Rebinding state: (1) client receives a DHCPNACK and go back to the init state and try a new IP address , (2) lease expires or (3) receive DHCPACK and go to Bound state
Dr. Clincy Lecture 12
CS
8640
Exchanging messagesThe figure below shows the exchange of messages related to the transition diagram
Dr. Clincy Lecture 13
CS
8640
DNS (Ch 17)
Dr. Clincy Lecture 14
CS
8640
Recall -Domain Name System (DNS)• As we mentioned before, the IP address is used to uniquely identify
hosts connected to the Internet (specifically “connections”)
• The actual IP address is hard to memorize or identify with
• People prefer names instead of addresses
• Therefore, we need a way of mapping a name to an address (or vice versa)
• In the old days, this mapping was done by each host and the host would update this file from a Master file
• Today, the Internet is too global and large for this approach
• One approach: have one computer holding these mappings (problem: too many hits – concentrated traffic congestion )
• Actual approach: replicate the mappings across distributed computers – the computer needing the info goes to the closest server – approach called DOMAIN NAME SYSTEM (DNS)
Dr. Clincy Lecture 15
CS
8640
DNS in the Internet• For the Internet, the domain name space is divided into 3 sections:
generic domains, country domains and inverse domains.
• Generic domains define registered hosts
according to their generic behavior.
Commercial orgs
Educational orgs
Government orgs
Some new:
Aero (airlines)
Biz (businesses)
Info (info services)
Name (personal name)
Etc..
• Country domains follow the same format as generic domains but uses a 2-character country abbreviation
Dr. Clincy Lecture 16
CS
8640
Inverse domain• Inverse domain is used to map an address to
a name.
• Server can have only the address and need to query the DNS server in mapping the address to name
• To follow the convention of reading the domain labels from bottom to top, an IP address in inverted
• For example, 132.34.45.121 (class B) is inverted to 121.45.34.132.in-addr.arpa
• Where in-addr is the second-level node and arpa is the first-level node
Inverse address
HOST (first name)NETWORK (last name)
HOST (first name) NETWORK (last name)
Dr. Clincy Lecture 17
CS
8640
RESOLUTION• Mapping a name to an address and vice versa is called name-address
resolution
• A host needing to map an address to a name (or vice versa) calls a DNS client (called a resolver)
• The resolver accesses the closet DNS server with the mapping request
• If the server has the info, it provides it
• If the server doesn’t have the info, it either gets the info from some other server OR it refers the resolver to some other server
• After the resolver receives the mapping, it determines if it’s correct or not – if correct, it sends the results to the requesting process
Dr. Clincy Lecture 18
CS
8640
Recursive resolution• Client is seeking an answer (ie. address for a name or name for an address)
• In this resolution case, the requesting client (resolver) expects the server to supply the final answer.
• If the server can’t resolve the mapping, it forwards the request to it’s parent server.
• If the parents server can’t resolve it, it’s sent to the next server – so forth
• Once the mapping is resolved, the response travels back to the requesting client
Dr. Clincy Lecture 19
CS
8640
Iterative resolution• In this resolution case, the requesting client sends a request
to the server
• If the server can’t resolve the mapping, it sends back to the requesting client the IP address of the server it thinks can resolve the mapping
• This continues until the mapping is resolved
Dr. Clincy Lecture 20
CS
8640
CACHING• Each time a server receives a query for a name not in it’s domain, it
has to do a search for the IP address
• Reducing these searches increases efficiency
• DNS does this by caching (or storing) the mapping responses in memory
• If the server sends a client a response from memory (cache) versus the actual server, the response is marked “un-authoritative”.
• Caching info too long could cause info to be out of date
• To fix this, 2 approaches are used:
• (1) the authoritative server attaches a “time-to-live” to the mapping and when that time expires, the server can’t send that info from cache
• (2) all of the timing is done with in the server itself – after a certain time limit, all mappings out of date are purged.
Dr. Clincy Lecture 21
CS
8640
DNS messages
• DNS has two types of messages: query and response
• Query message consists of a header and question records
• Response message consists of a header, question records, answer records, authoritative records and additional records
Dr. Clincy Lecture 22
CS
8640
Header format• Header fields are:
• Identification: used by the client to match the response with the query
• # of question records: # of queries in the question section of the message
• # of answer records: # of answer records in the answer section of the response
• # of authoritative records: # of authoritative records in the authoritative section of the response
• # of additional records: # of additional records in the response message
• Flags:
QR: defines the type of message (query or response)OpCode: defines the type of query or responseAA: Authoritative – if set, it means the name server is an authoritative serverTC: Truncated – if set, means the response was more than 512 bytes and truncated to 512RD: Recursion Desired – if set, means the client desires a recursive answerRA: Recursion Available – if set, means a recursive response is availablerCode: Shows the Status of the error in the response
Dr. Clincy Lecture 23
CS
8640 Question record format
TYPES OF RECORDS
• 2 types of records: question and resource
• For DNS, question records are used in the question section of the query and response messages
• For DNS, resource records are used in the answer, authoritative and additional info sections of the response message only.
• The question records are used by the client in getting info from the server
• Query Name: contains the domain name
• Query Type: defines the type of query (ie. (1) convert domain name to address, (2) id authoritative servers for zone, etc..
• Query Class: defines the protocol using DNS
Dr. Clincy Lecture 24
CS
8640
Resource record format
• Each domain (node in the tree) is associated with a record called the resource record.
• Domain Name (see format below)
• Domain type: type of query
• Domain class: defines the protocol using DNS
• Time to live: # of sec the answer is valid
• Resource data length: defines the length of the resource data
• Resource data: variable length field – contains (1) answer to the query, (2) domain name of the authoritative server or (3) additional info
admin.atc.fhda.edu.
Dr. Clincy Lecture 25
CS
8640
Format of an offset pointer
• DNS defines a 2-byte offset pointer that points to a previous occurrence of the domain.
• For example, the domain name in the question record is repeated in the resource record however, instead of the name, a pointer is provided
• The 2 high-order bits are 11 – to indicate this is a pointer
• The other 14 bits represent a number that points to the corresponding byte number in the message
Dr. Clincy Lecture 26
CS
8640
Example 1Example 1
A resolver sends a query message to a local server to find the IP address for the host “chal.fhda.edu.”. We will illustrate the query and response messages separately.
Dr. Clincy Lecture 27
CS
8640
Example of a query message• First 2 bytes show an identifier (1333) which relates a response to a query
• The sequence of bits for the flag below is 0000000100000000
• The sequence of binary flag bits are translated to hex (0100)
• # of question records, # of answer records, # of authoritative records, # of additional records
• 4chal4fhda3edu0
•Query type(IP address), Class (Internet)
Dr. Clincy Lecture 28
CS
8640
Example of a response message• First 2 bytes show an identifier (1333) which relates a response to a query
• The sequence of bits for the flag below is 1 0000 0 0 1 1 000 0000
• The sequence of binary flag bits are translated to hex (8180)
• # of question records, # of answer records, # of authoritative records, # of additional records
Points to domain versus repeating it
Time to live (12000 seconds)
Size of the IP address
The IP address
Dr. Clincy Lecture 29
CS
8640
Chapter 10Chapter 10Mobile IPMobile IP
Dr. Clincy Lecture 30
CS
8640
Issues
Difference Between Wireless LANS and Mobile IPDifference Between Wireless LANS and Mobile IP•Wireless LANS are stationary – nodes are stationaryWireless LANS are stationary – nodes are stationary•Mobile IP – nodes can be mobile Mobile IP – nodes can be mobile
The IP addresses are designed to work with stationary hosts because part of the address defines the network to which the host is attached.
Therefore, for mobility reasons, IP has to be enhanced
With the current IP, a host DOES NOT have an IP address it can carry with itself hop to hop
Dr. Clincy Lecture 31
CS
8640
Facilitating Mobility – 2 approachesApproach 1:Approach 1:Let the mobile host be able to change its address as it Let the mobile host be able to change its address as it moves from network to network moves from network to network
The mobile host could use DHCP to secure a new address The mobile host could use DHCP to secure a new address at each networkat each network
Issue 1: Config files would need to be updatedIssue 1: Config files would need to be updatedIssue 2: reboot at each networkIssue 2: reboot at each networkIssue 3: DNS tables need updating in reflecting the changeIssue 3: DNS tables need updating in reflecting the changeIssue 4: Suppose the host leaves one network while some Issue 4: Suppose the host leaves one network while some other host is sending it data ??other host is sending it data ??
Dr. Clincy Lecture 32
CS
8640
Another Approach - Big Picture Given the agent discovery and registration have occurred, a mobile host now communicate with a remote host
(1A) Remote host send packet to mobile host as if mobile host is in its home network
(1B) The packet is intercepted by the home agent acting on behalf of the mobile host
(2) The home agent then sends the packet to the foreign host via tunneling (encapsulate the IP packet into another packet that has Tx & Rx addresses for the home agent and foreign agent)
(3) The foreign agent then decapsulate the packet from the IP packet and consult a registry that cross-referenced the source address of the packet (the mobile host’s home address) with the local care-of address of the mobile host
(4) When the mobile host wants to reply back to the remote host, it sends it in the normal manner using the destination address of the packet as now the source address of the reply
Dr. Clincy Lecture 33
CS
8640
Another ApproachUse 2 addressesHost keeps its original address (called home address)Host also has a temporary address (called care-of address)
Home address is permanent and associates the host to its Home networkWhen the host moves from network to network, the care-of address changesThe care-of address is associated with the Foreign network
When the host moves from its home network (131.5.0.0) to network 14.0.0.0, it receives a care-of address during the agent discovery and registration phase
Dr. Clincy Lecture 34
CS
8640
How is the address change made transparent ?
To make the change of address transparent to the rest of the Internet To make the change of address transparent to the rest of the Internet requires a requires a home agenthome agent and a and a foreign agentforeign agent. The specific function of an . The specific function of an agent is performed in the application layer.agent is performed in the application layer.
Home Agent is usually a router attached to the home network. Home Agent acts on behalf of the mobile host when a remote host sends data to the mobile host.
The Home Agent receives the data and sends it to the foreign agent
Foreign Agent is usually a router attached to the foreign network
The Foreign Agent’s job is to receive packets from the Home agent (intended for the mobile host) and forward the received packets to the mobile host
When the mobile host and the foreign agent are the same, the care-of address is called a co-located care-of addressAdvantage: As the mobile host moves to network to network, doesn’t have to worry if a foreign agent is in the network. Disadvantage: mobile host will need special software that will allow it to have 2 addresses (both its home address and care-of address)
Dr. Clincy Lecture 35
CS
8640
Remote host and mobile host communicationTo communicate with a remote host, a mobile host goes through three phases: agent To communicate with a remote host, a mobile host goes through three phases: agent discovery, registration, and data transfer.discovery, registration, and data transfer.
First Phase: Agent Discovery –First Phase: Agent Discovery – Keep in mind that the home agent acts in behalf of the mobile host – so before leaving the home network, the mobile host must learn or DISCOVER the home agent’s address
After the mobile host moves to the foreign network, the mobile host must learn or DISCOVER the foreign agent’s address
The discovery involves two types of messages:
Agent Advertisement
Agent Solicitation
Dr. Clincy Lecture 36
CS
8640
1st Phase: Agent AdvertisementMobile IP does not use a new packet type for agent advertisement; it uses the router advertisement packet of ICMP, and appends an agent advertisement message.
Code field – 8-bit flag
• Type is set to 16
• Length is the total length
• Sequence # holds the message number & message # used to determine if a message is lost
• Lifetime is # seconds the agent will accept requests
• List of care-of addresses available (the use of the care-of address is announced in the registration request)
Dr. Clincy Lecture 37
CS
8640
Once the mobile host has moved to the foreign network, if it (mobile host) hasn’t received any agent advertisements – it can initiate an agent ad by initiating an agent solicitation.
It uses ICMP’s solicitation message. Mobile IP does not use a new packet type for agent solicitation; it uses the router solicitation packet of ICMP.
1st Phase: Agent Solicitation
Dr. Clincy Lecture 38
CS
8640
2nd Phase: Registration Request and Reply
The second phase is registration. After the mobile host moves to the foreign network and discovers the foreign agent, it must register:
1. Register itself with the foreign agent
2. Register itself with its home agent – foreign agent does this for the mobile host
3. Mobile host must renew registration if it expires
4. Mobile host must cancel registration when it returns to home network
To register with a foreign agent and the home agent, the mobile host uses a registration request and a registration reply
Dr. Clincy Lecture 39
CS
8640
2nd Phase: Registration Request and ReplyA registration request is sent from the mobile host to the foreign agent to register its:
Care-of address, and to
Announce its home address and home agent’s address
After the foreign agent registers the request, it relays the message to the home agent – as result, the home agent now knows the address of the foreign agent (source address of relay)
Dr. Clincy Lecture 40
CS
8640
Registration request format• Type is set to 1 for a request
• Sequence # holds the message number & message # used to determine if a message is lost
• Lifetime is # seconds the registration is valid (string of 0s mean deregistration, string of 1s means infinite)
• Home Address address of
the mobile agent
• Home Agent Address
• Care-of Address
• Identification – 64-bit number to match up the request with the reply
• Extension – the home agent use this to authenticate to mobile agent
• Flag defines forwarding info
Dr. Clincy Lecture 41
CS
8640
Registration reply format
A registration reply is sent from the home agent to the foreign agent and then relayed to the mobile host. The reply confirms or denies the registration request
Dr. Clincy Lecture 42
CS
8640
Big Picture – Data TransferGiven the agent discovery and registration have occurred, a mobile host now communicate with a remote host
(1A) Remote host send packet to mobile host as if mobile host is in its home network
(1B) The packet is intercepted by the home agent acting on behalf of the mobile host
(2) The home agent then sends the packet to the foreign host via tunneling (encapsulate the IP packet into another packet that has Tx & Rx addresses for the home agent and foreign agent)
(3) The foreign agent then decapsulate the packet from the IP packet and consult a registry that cross-referenced the source address of the packet (the mobile host’s home address) with the local care-of address of the mobile host
(4) When the mobile host wants to reply back to the remote host, it sends it in the normal manner using the destination address of the packet as now the source address of the reply
Dr. Clincy Lecture 43
CS
8640
INEFFICIENCY IN MOBILE IPCommunication involving mobile IP can be inefficient. A severe Communication involving mobile IP can be inefficient. A severe case is called case is called double crossingdouble crossing or 2X. A moderate case is called or 2X. A moderate case is called triangle routingtriangle routing or dog-leg routing. or dog-leg routing.
Double crossing occurs when the mobile host moves to the same network as the remote host - when the remote hosts sends to the mobile host, instead of the sending being LOCAL, it crosses the Internet twice ((1) going to the home agent and (2) coming back from the home agent)
Dr. Clincy Lecture 44
CS
8640
INEFFICIENCY IN MOBILE IPCommunication involving mobile IP can be inefficient. A severe Communication involving mobile IP can be inefficient. A severe case is called case is called double crossingdouble crossing or 2X. A moderate case is called or 2X. A moderate case is called triangle routingtriangle routing or dog-leg routing. or dog-leg routing.
Triangle Routing occurs when the remote host communicates with a mobile host that is not in the same network When the remote hosts sends to the mobile host – it goes from the remote host to the home agent, then from the home agent to the mobile host (this is the triangle) – it could have gone directly from the remote host to the mobile host.
Dr. Clincy Lecture 45
CS
8640
INEFFICIENCY IN MOBILE IP
One SolutionOne Solution
The remote host could bind the care-of address to the home address of the mobile host – by doing so, the remote host could refer to its registry to determine the care-of address given the home address and then send directly to the care-of address.
This could be implemented by the home agent sending an update binding packet back to the remote host
The problem is, once the mobile host moves, the remote hosts registry of care-of addresses will need to be updated
In this case, the home agent could send the remote host a warning packet to inform it of the change
Recommended