Download Packet switching

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Wireless security wikipedia , lookup

Network tap wikipedia , lookup

Computer security wikipedia , lookup

AppleTalk wikipedia , lookup

Airborne Networking wikipedia , lookup

Asynchronous Transfer Mode wikipedia , lookup

RapidIO wikipedia , lookup

Distributed firewall wikipedia , lookup

Computer network wikipedia , lookup

Net bias wikipedia , lookup

IEEE 1355 wikipedia , lookup

Remote Desktop Services wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Internet protocol suite wikipedia , lookup

Real-Time Messaging Protocol wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Deep packet inspection wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

UniPro protocol stack wikipedia , lookup

Transcript
6 UNIX Network Utilities
Mauro Jaskelioff
Introduction
• Overview of computer networks
• Network related utilities
– Accessing a remote computer
– Transferring files between computers
– Network diagnostics
Types of networks
• Circuit switching: the nodes agree to
communicate and the communication
medium is reserved for this purpose
• Example: Telephone
• Packet switching: information is divided
into packets, and each packet is sent
individually by the source node. The
information is reassembled by the
destination node.
• Most computer networks are packet
switching
Packet switched networks
• Main example: Internet
• Uses a family of protocols called TCP/IP
• What is a protocol?
– A protocol is an agreed set of rules for one
computer to ‘talk’ with another. They ensure
that data is sent in the correct way and that it
is therefore understandable when it reaches
it’s destination.
• The responsibility of delivering the
information is divided into different
protocol layers
TCP/IP Model
• Layer 1 - Network Access Layer - This layer
describes the physical equipment necessary for
communications, such as twisted pair cables, the
signalling used on that equipment, and the lowlevel protocols using that signalling.
• Layer 2 - Internet or Internetworking Layer This layer defines IP addresses, with many routing
schemes for navigating packets from one IP
address to another.
• Layer 3 - Host-To-Host (Transport) Layer This is where flow-control and connection protocols
exist, such as TCP. This layer deals with opening
and maintaining connections, ensuring that
packets are in fact received.
• Layer 4 - Process Layer or Application Layer This is where the "higher level" protocols such as
HTTP, SMTP, SSH, , etc. operate.
Structure of packets
• Each IP packet contains
– A header with information, such as destination
address, source address, time to live (TTL),
protocol.
– A payload: The data to be sent. This may be a
packet of an upper layer.
• A TCP packet contains
– A header with information, such as destination
port, source port, order in sequence.
– A payload: The data to be sent.
IP Addresses and Names
• IP Addresses are 32 bit numbers.
• Usually written as 4 bytes (0-255)
separated by dots (e.g. 10.21.1.56)
• These addresses are difficult to remember
for humans.
• The domain name service (DNS) is used to
translate from human-readable addresses
(www.nottingham.edu.cn) to IP addresses
(128.243.40.30) and back
Some methods for UNIX access
• Telnet
• FTP
• SSH
• SFTP
• No Machine
Telnet
• Client – Server application
Telnet protocol
Client
(application on the
machine you use)
Server
(application accepts instructions
from client and returns data)
Telnet Client
• These applications turn the local
computer into a dumb terminal.
• Used for remote access to user
accounts.
• E.g.:
telnet unnc-cslinux.nottingham.edu.cn
– (N.B. telnet is not supported in CS! WHY?)
Telnet Server
• Typically a UNIX machine
• Also on some networking devices,
like routers and switches
• Runs on port 23
• Allows clients access to a more
powerful computer, or a computer
without screen (like a router)
Telnet Disadvantages
• Telnet was one of the first internet
applications.
• It transfers data as ASCII text
– What is ASCII text?
• This means that information passed
across the internet using telnet is
open and insecure.
• Need a more secure alternative!
SSH (Secure SHell)
• ssh is another application protocol
– allows secure, encrypted communications
between remote computers.
– NOTE: the network doesn’t need to be secure,
the SSH protocol and applications ensure the
security themselves.
• There are commercial, Open Source and
Freeware applications.
• Example: Putty
SSH example
SSH command line access
• ssh <username>@robin.cs.nott.ac.uk
• The first time you access an unknown
host, the ssh client will ask you if you
want to proceed and authorise the host
“yes/no”. Type ‘yes’ and press enter.
• This will generate the encryption key that
will allow for a secure connection.
FTP (File Transfer Protocol)
• Allows you to transfer files between your
client FTP application and an FTP server.
• ftp robin.cs.nott.ac.uk
– You will be prompted for a username and
password
• Some servers allow anonymous FTP
– These allow anyone access to the files stored
(obviously nothing sensitive or private will be
stored!)
– For anonymous FTP, you enter “anonymous”
as your username and anything for your
password (entering your email address is
polite)
FTP (2)
• The ftp utility has its own set of UNIX
like commands which allow you to
perform tasks such as:
– Connect and login to a remote host
– Navigate directories
– List directory contents
– Put and get files
– Transfer files as ascii, ebcdic or binary
FTP Disadvantages
• However like Telnet, FTP is an
insecure protocol as it transmits data
(including your password) as ASCII
text.
• Like telnet, we need a more secure
system, enter SFTP!
SFTP (Secure File Transfer
Protocol)
• SFTP like FTP allows you to transfer
files between networks.
• Unlike FTP, it uses the SSH transport
protocols – hence SFTP transfer is
encrypted and secure
– E.g.: sftp [email protected]
– (OR use SSH Secure Copy, scp)
No Machine (NX)
• No Machine is an X Windows
emulator for Windows
• Allows users to access a UNIX
system using a graphical user
interface
• See lecture 1 for more information
ping
• Sends an echo request to a network
host.
• It is useful for:
– Determining the status of the network
and various foreign hosts
– Tracking and isolating hardware and
software problems
– Testing, measuring, and managing
networks
ping (2)
• The ping command sends one
datagram (packet of information) per
second and prints one line of output
for every response received.
• Round-trip times and packet loss
statistics are calculated and
displayed.
ping Example
% ping kanaha
PING kanaha.mhpcc.edu: (164.122.27.33): 56 data bytes
64 bytes from 164.122.27.33: icmp_seq=0 ttl=254 time=3 ms
64 bytes from 164.122.27.33: icmp_seq=1 ttl=254 time=2 ms
64 bytes from 164.122.27.33: icmp_seq=2 ttl=254 time=2 ms
64 bytes from 164.122.27.33: icmp_seq=3 ttl=254 time=2 ms
64 bytes from 164.122.27.33: icmp_seq=4 ttl=254 time=2 ms
64 bytes from 164.122.27.33: icmp_seq=5 ttl=254 time=2 ms
^C
----kanaha.mhpcc.edu PING Statistics---6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 2/2/3 ms
Traceroute
• traceroute works as ping but
printing the route taken to the target
host.
traceroute www.google.cn
traceroute to cn.l.google.com (59.151.21.100), 30 hops max, 38 byte
packets
1 10.252.0.11 0.580 ms 0.520 ms 0.516 ms
2 10.254.0.11 1.188 ms 1.203 ms 1.194 ms
3 220.191.168.17 2.181 ms 1.863 ms 2.222 ms
4 61.174.69.101 3.711 ms 2.894 ms 2.513 ms
5 61.174.69.49 46.508 ms 8.999 ms 4.599 ms
6 202.97.41.237 11.754 ms 202.97.41.245 11.809 ms 11.681 ms
.
.
.
finger (Revisited)
• The finger command displays
information about users on a given
host
• The host can be either local or
remote
• Finger can be used to show who is
logged on to the system:
– finger - show all local logins
– finger @marian.cs.nott.ac.uk - show
remote system's logins
finger (Revisited) (2)
• Finger can also be used to show
information about a specific user:
– finger zlizmj - look for a local user
– finger [email protected] look for a remote user
talk and write
• Allows two users on the same host or on
different hosts to have an interactive
conversation
• For it to work, talkd should be running,
and we should enable messages with
mesg y
• write reads lines from a user’s standard
input and writes them to the terminal of
another user
• E.g.:
– write zlizmj
Other ‘Classical’ Utilities
• Several UNIX utilities are especially
useful for users computing in a
networked, distributed environment
• Examples are:
– rlogin, rsh, rcp, ruptime
– rwho, rusers
• But for security reasons they are
usually disabled
Netcat
•
•
The comand nc is like cat but works on
networks connections.
It can send its STDIN to a network socket:
$ nc unnc-cslinux 4000
(send input to port 4000 on host unnc-cslinux)
•
It can listen to some port and display the
incoming data on STDOUT
$ nc –l –p 4000
(listen to port 4000, incoming data goes to stdout)
•
You only can listen to port numbers above 1023
(the lower numbers are reserved)
Summary
• Overview of networks
• Some methods for accessing a
remote computer
• Some methods for transferring files
• Some useful commands for
troubleshooting networks
• Talking to other users on the
network