Upload
phamhuong
View
240
Download
0
Embed Size (px)
Citation preview
BOOTP, DHCPTELNET: TErminaL NETwork
Aplicatii Client-ServerBOOTP, DHCP, TELNET
Gabriel Ciobanu
Facultatea de InformaticaUniversitatea A.I. Cuza, Iasi
Nivel Aplicatie
Dorin Huzum ([email protected])Sinica Alboaie ([email protected])
Cristian Paslaru ([email protected]
http://www.info.uaic.ro/∼dorin.huzum/rc
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 1 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Protocoale binecunoscute la nivelul aplicatie
Nivelul aplicatie pune la dispozitie o serie de serviciiInternet standard:
Configurare retea (BOOTP, DHCP)Terminal la distanta (TELNET, SSH, . . .)Posta electronica (SMTP, IMAP, POP,. . .)Transferul de fisiere (TFTP, FTP)World-Wide Web (HTTP, WWW)Conversatii instantanee (IRC, ICQ, Jabber, . . .)
Protocoale pentru rezolvarea unor sarcini de sistem -/etc/services, /etc/protocols
Sistemul de fisiere in retea (NFS)Conectivitate cu alte sisteme de fisiere (SMB)Servicii de baze de date (MySQL, PostgreSQL, . . .)
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 2 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
Cuprins
1 BOOTP, DHCPStatic configuration: BOOTPDynamic configuration: DHCP
2 TELNET: TErminaL NETwork
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 3 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
BOOTP: Bootstrap Protocol
client-server paradigm is applied to bootstrapping
A host connected to an internetwork needs to know its IPaddress before it can send or receive datagrams
Overall, a host needs to know at least the following:
its IP addressits subnet maskthe IP address of a routerthe IP address of a domain name server
BOOTP and DHCP make it possible to boot a machinethrough an IP network without using RARP
both are based on UDP, and use specific formats
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 4 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
BOOTP: BOOTstrap Protocol
At startup, a diskless workstation has an initializationroutine stored in ROM, which is the same for all machines(then its specific IP address cannot be stored in the ROM)
Using RARP has at least three draw-backs:
RARP is low-level network-dependent protocol, thereforeusing it requires access to the physical network interfaceThe efficiency of RARP is low, the minimum-sizeEthernet- message is 512-bit long but only contains 32bits of useful information (the IP address)Because RARP is based on the physical network address,it cannot be used in networks, where the address isassigned dynamically
BOOTP and its extension DHCP address these problems
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 5 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
BOOTP
BOOTP is based on UDP, and it can be implementedwithout access to the hardware levelBOOTP is more efficient than RARP (more informationthan the IP address is transferred in the message)BOOTP includes a field that makes it possible to transfervendor-dependent information using the protocolIP address 255.255.255.255 defines a limited broadcastand it can be used without knowing ones own IP address(it can use ”0.0.0.0” as its sender address)assume that work station A sends a BOOTP request toserver B, which chooses an IP address for A but cannotyet use ARP to update its own routing tableIn practice, B either broadcast its reply or derive the MACaddress of A from the BOOTREQUEST message
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 6 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
BOOTP packet
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 7 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
BOOTP option
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 8 / 42
TCP/IP Protocol Suite 8
Table 16.1 Table 16.1 Options for BOOTPOptions for BOOTP
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
BOOTP client-server
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 9 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
Two-Step Bootstrap Procedure
BOOTP does not provide clients with a memory image; itonly provides a file name. The client then uses a secondprotocol (tftp) to obtain the memory image.
client can fill BOOT FILE NAME a generic name like“uni; t. The server consults it configuration database tomap the generic name into a specific file name for client.
If client fills zeros in the BOOT FILE NAME field,BOOTP selects a memory image of the machine.
Clients use port 68 instead of an ephemeral port. This isbecause the reply from the server can be broadcast (receivedby all hosts).— Relay agent... Error control...
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 10 / 42
TCP/IP Protocol Suite 4
Figure 16.2 Client and server on two different networks
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
DHCP: Dynamic Host Configuration Protocol
BOOTP was designed for a static environment
BOOTP does not apply well to portable workstations,because it only provides a static mapping from theidentification of a workstation to its parameters
The parameters need to be defined and stored to theconfig. file of the BOOTP server separately for each host
If the hosts often change locations or the number of hostsexceeds the number of available IP addresses, this leadsinto difficultiesTo facilitate automatic address allocation, the IETF hasdefined DHCP, which extends BOOTP in two ways:
The host gets all configuration information in onemessageThe host receives its IP address fast and dynamically
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 11 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
DHCP: Dynamic Host Configuration Protocol
DHCP makes it possible to allocate an IP address in threeways, out of which the administrator can choose the onethat best suits each network or host:
Like BOOTP, DHCP allows manual configurationAutomatic configuration means, that DHCP assigns apermanent IP address for a new hostDynamic configuration means, that the host leases its IPaddress from a common address pool when it starts
Dynamic configuration is the most interesting one ofthese alternatives because (it allows any computer to beconnected to the network without prior arrangements)If the host is attached to several networks, it has toperform DHCP separately for each network interfacesBOOTP and DHCP facilitate the booting from anothernetwork by using a relay agent
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 12 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
DHCP packet
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 13 / 42
TCP/IP Protocol Suite 12
Table 16.2 Table 16.2 Options for DHCPOptions for DHCP
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
DHCP
A host becomes a DHCP client when it broadcasts theDHCPDISCOVER message to all DHCP servers of thelocal networkEach DHCP server replies with an offer, containingconfiguration information and the IP address the server isoffering to lease to the client, sent in a DHCPOFFERmessageThe host chooses one of the offers and sends aDHCPREQUEST message to the respective serverThe server confirms the lease with a DHCPACK messageA machine may terminate the lease by sending aDHCPRELEASE messageThe protocol logic of DHCP is presented as a statetransition diagram
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 14 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
DHCP Transition Diagram
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 15 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
DHCP Exchanging Messages
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 16 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Static configuration: BOOTPDynamic configuration: DHCP
DHCP Exchanging Messages
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 17 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Cuprins
1 BOOTP, DHCP
2 TELNET: TErminaL NETworkTelnet
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 18 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Telnet
a general-purpose client-server program for virtualterminal
connection to a remote system such that the localterminal appears to be a terminal at the remote system
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 19 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Time-sharing environment
a large computer supports multiple users
interaction user-computer is given by a terminal
users have login names, passwords, and access rights toresources
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 20 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Time-sharing Environment (local login)
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 21 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Time-sharing Environment (remote login)
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 22 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Telnet
telnet client overrides the local interpretation the keys,allowing a user to interact with a remote machine exactlyas one would from a locally connected terminal
telnet alllows a TCP connection, and then passeskeystrokes from the local keyboard directly to the remotecomputer as if they had been typed on a keyboardattached to remote machine
pseudoterminal: impossible to build a TELNET serverunless the OS supplies such a facility
TELNET server at application level has advantages (easyto modify) and disadvantages (inefficiency).
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 23 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Network Virtual Terminal (NVT) characters
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 24 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
NVT character sets: data and commands
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 25 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
NVT remote control characters
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 26 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
IAC (Interpret As Control)
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 27 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Option Negotiation
To negotiate an option, either side may send one of fouroption requests:
WILL - The sender wants to set an option.
WONT - The sender wants to disable the option.
DO - The sender wants the receiver to set the option.
DONT - The sender wants the receiver to disable theoption.
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 28 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Offer/request to enable
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 29 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Offer/request to disable
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 30 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Example of Echo option
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 31 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Suboption negotiation
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 32 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Controlling the server
Some of the control characters can be used to control theremote server.
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 33 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Control Functions
IP (interrupt process) function requests the server toabort the currently running user process. (e.g., IAC IP(255 244)); this function only terminates the runningprocess, not the entire remote terminal session.AO (abort output) function is used when a user processon the server has generated output the user does notwant to see; similar to IP function, except that AO willnot abort the user process.AYT (Are you there) facility enables a user to determinewhether the server is still active.EC (erase char) function is used to delete the lastpreceding undeleted character transmitted.EL (erase line) function is used to delete an entire line ofinput.
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 34 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Example of interruption
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 35 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Out-of-band signalling
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 36 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Example of interruptions
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 37 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Modes of operation
Default mode (half-duplex)
echoing is done by the clientclient does not send until whole line is complete.
Character Mode
the user enters a char that is sent to the server.server ack the receiving char, and echos the char back.client ack.
Line mode (full duplex w/o GA)
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 38 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Example 1
A client and a server negotiate the terminal type and terminalspeed and then the server checks the login and password ofthe user. We use the default mode to show the concept andits deficiencies even though it is almost obsolete today.
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 39 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Example 1
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 40 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Example 2
A client switches to the character mode. This requires a clientto ask the server to enable the SUPPRESS GO AHEAD andECHO options.
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 41 / 42
BOOTP, DHCPTELNET: TErminaL NETwork
Telnet
Example 2
Aplicatii Client-Server BOOTP, DHCP, TELNET noiembrie 2007 42 / 42