Applications: Remote Login (TELNET ,Rlogin)
Download
Report
Transcript Applications: Remote Login (TELNET ,Rlogin)
Applications: Remote Login
(TELNET ,Rlogin)
• In this chapter we shall explore
internetworking by examining high level
internet services and protocols that support
them.
• These services form an integral part of TCP/IP.
• High Level services provide increased
communication functionality,and allow users
and programs to interact with automated
services on remote machines and with remote
users.
Remote Interactive Computing
• A remote system can be contacted using the
client-server model.
• For this a specially designed server is
required and there is a possibility of the
remote machine getting swamped with
server processes.
• We can avoid this and provide more
generality by allowing a user to establish a
login session on a remote machine and then
execute commands .
TELNET Protocol
• Telnet allows a user to log into a computer
across an internet.
• Telnet establishes a TCP connection and
then passes keystrokes from the users
keyboard directly to the remote computer .
• The client software asks the user to specify
domain name or IP address of the remote
machine to be contacted.
TELNET Services
Telnet offers three basic services .
1. It defines a network virtual terminal that
provides a standard interface to remote
systems.
2. Telnet includes a mechanism that allows the
client and server to negotiate options .
3. Telnet treats both ends of the connection
symmetrically.
TELNET Operation
Pros And Cons Of TELNET Server As An
Application Program
Advantage
• It makes modification and control of the
server easier than if the code were
embedded in the operating system.
Disadvantage
• Inefficiency - Each keystroke travels from
client keyboard - client OS - client program
-server program-server OS and back to
client program.
Accommodating Heterogeneity
• TELNET interoperate between as many systems
as possible.
• TELNET must accommodate the details of
heterogeneous computers and operating systems.
• For example:
– In some systems lines of text are terminated by
the ASCII carriage control character (CR).
– Some require ASCII linefeed (LF) character.
– Some require the two-character sequence of
CR-LF.
Accommodating Heterogeneity
• TELNET defines how data and command
sequences are sent across the internet known as
network virtual terminal (NVT).
• Fig. 25.2 illustrates.
– The Client Software translates keystrokes and
command sequences from the user’s terminal in
to NVT and sends them to the server.
– Server software translates incoming data and
commands from NVT format into the format
the remote system requires.
Accommodating Heterogeneity
• For data returning, the remote server translates
from the remote machine’s format to NVT, and the
local client translates from NVT to the local
machine’s format.
• All communication involves 8-bit bytes.
• At startup, NVT uses the standard 7-bit USASCII
representation for data.
• USASCII character set includes 95 characters that
have “printable” graphics and 33 “control” codes.
Accommodating Heterogeneity
• The NVT standard defines interpretations for
control characters as shown in Fig. 25.3.
• NVT also defines the standard line termination to
be a two-character sequence CR-LF.
– TELNET client map the end-of-line of local
terminal into CR-LF for transmission.
– TELNET server translates CR-LF into the
appropriate end-of-line character sequence for
the remote machine.
Passing Commands That Control the
Remote Side
• UNIX systems reserve character generated by
CONTROL-C as the interrupt key.
• Depressing CONTROL-C key causes UNIX to
terminate the executing program.
• TELNET NVT accommodates control functions
by defining how they are passed from the client to
the server.
• NVT defines a conceptual “interrupt” key that
requests program termination.
Passing Commands That Control the
Remote Side
• Fig. 25.4 lists the control functions NVT
recognizes.
• The Client receives control functions from a
user in addition to normal data and passes
them to the server system where they must
be interpreted.
Passing Commands That Control the
Remote Side
• TELNET encodes the control functions as escape
sequence across the TCP connection.
• An escape sequence uses a reserved octet to
indicate that a control code octet follows. In
Telnet, the reserved octet that starts an escape
sequence is known as the interpret as command
IAC) octet.
• Fig 25.5 lists the possible commands and the
decimal encoding used for each.
Passing Commands That Control the
Remote Side
• Signals generated by conceptual keys on an
NVT key-board each have a corresponding
command.
Forcing The Server To Read A Control
Function
• TELNET cannot rely on the conventional data
stream alone to carry control sequences between
client and server.
• TELNET uses an out of band signal to solve this
problem.
• TCP implements out of band signaling with the
urgent data mechanism.
• TELNET appends a reserved octet called data
mark.
.
Forcing The Server To Read A Control
Function
• TELNET causes TCP to signal the server by
sending a segment with URGENT DATA bit set.
• Segments carrying urgent data bypass flow control
and reach the server immediately.
• The server reads and discards all data until if finds
the data mark.
• The server returns to normal processing when it
encounters the data mark.
Telnet Options
TELNET option negotiation is done between the client and
server:
• Usually a data stream passes a 7-bit data and uses the
highest-order (8th bit) to pass control information.
• Using option negotiation, TELNET can also use an 8-bit data
character set.
In the case of 8-bit data sets:
- Both ends must agree to use 8-bit data.
This is done by exchanging ``option code sequences''.
- TELNET defines a special byte, the Interpret As Command
(IAC) with the value 255.
- TELNET uses in-band signaling and IAC must be doubled.
- When IAC is received, the following byte(s) is interpreted
as a TELNET Command.
• Either end of the connection (client or server) can request options.
Commonly Used TELNET Options
• Variety of options can be negotiated between a TELNET
client and server using commands at any stage during the
connection for separate RFCs.
- Transmit Binary: Change transmission to Binary.
- Echo: Usually enabled by the server, to indicate that
the server will echo every character it receives.
- Suppress-GA: Original TELNET implementation defaulted to
“half duplex" operation. Modern links normally allow
bidirectional operation(Full duplex) and the
"suppress go ahead" option is enabled.
Commonly used Telnet Options
- Status: Request for status of a TELNET option from
a remote site.
- Timing-Mark: Request Timing mark be inserted in
return stream to synchronize two ends of connection.
- Terminal-Type: Exchange information about the make
and model of a terminal being used.
- End-of-Record: Terminate data sent with EOR code.
- Limemode: Complete lines are assembled at each end
and transmitted in one "go".
TELNET Option Negotiation
• Options are agreed by a process of negotiation which
results in the client and server having a common view
of various extra capabilities that affect the interchange
and the operation of applications.
• Either end of a TELNET dialogue can enable or disable
an option either locally or remotely.
• The initiator sends a 3 byte command of the form
IAC,<type of operation>,<option>
• The response is of the same form.
TELNET Option Negotiation
Operation is one of :
Description Code Meaning
WILL
251
Sender wants to enable the option.
DO
252
Sender wants the receiver to enable option.
WONT
253
Sender wants to disable the option.
DONT
254
Sender wants the receiver to disable option.
Associated with each of the these there are various possible
responses :
- If the Sender sends a request WILL X and if the Receiver
Responds DO X, it implies that, the sender would like to use
a certain facility if the receiver can handle it.
Receiver agrees and the Option is now in effect.
- If the Sender sends WILL X and if the Receiver Responds
DON’T Receiver says it cannot support the option.
Option is not in effect.
TELNET Option Negotiation
- Similarly DO X requests that the receiving party begin using
option X, and WILL X or WON’T X means the receiver would
start using option X and the option is in effect or the receiver
would not use option X and so the option is not in effect.
- Negotiation requires 3 bytes.
- For example if the sender wants the other end to
suppress go-ahead it would send the byte sequence
255(IAC),251(WILL),3
The final byte of the three byte sequence identifies the required
action.
Rlogin (BSD UNIX)
• Rlogin is the 4.3 BSD UNIX remote login service that
supports trusted hosts (automatic authorization).
• Rlogin allow a user to log in on another host via a network.
• If not explicitly denoted, rlogin attempts to login a user on the
destination machine using the same user name and password
as the source.
• Thus it makes it possible for a user to have login name X on
one machine and Y on another, and still be able to remotely login
from one of the machines to the other without typing a password
each time.
Rlogin (BSD UNIX)
Rsh (remote shell):
- Invokes a command interpreter on the remote UNIX machine.
Passes any command line arguments to the command interpreter,
skipping the login step completely.
The format of a command invocation using rsh is:
rsh machine command
- For example typing,
rsh merlin ps
on any one of the machines in the Purdue Univ. executes the ps
command on the machine merlin, with UNIX’s standard input and
standard output connected across the network to the user’s
keyboard and display. The user sees the output as if he or she were
logged into machine merlin.
Rlogin (BSD UNIX)
- rsh does not ask for a password, so it can be used in
programs as well as from the keyboard.
- This may be a security issue at certain sites, so administrators
may not allow executing programs to utilize this command.
• rlogin understands UNIX notions of standard input, standard
output, and standard error as well as terminal control functions
(understands both local and remote computing environments).
For this reason, it communicates better than general purpose
remote login protocols (like TELNET).
Summary
• TELNET provided by most TCP/IP implementations works
between hosts using different operating systems.
• Rlogin from BSD UNIX designed to work between UNIX
systems only.
• TELNET has many options.
• Rlogin provides only one option. Option negotiation not required.
• In contrast to TELNET, rlogin allows system managers and users
more flexibility to establish equivalence of accounts on
multiple machines, but it is not as widely available as TELNET.
Practical Example
• Telnet from host with IP address
(12.111.96.233) to Router with IP Address
(12.21.0.1).
• Capturing frames using Sniffer.
• Sniffer is a software tool used by network
administrators for testing, analyzing
network traffic and design.