1 / 30

6 UNIX Network Utilities

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.

tasha-chase
Download Presentation

6 UNIX Network Utilities

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 6 UNIX Network Utilities Mauro Jaskelioff

  2. Introduction • Overview of computer networks • Network related utilities • Accessing a remote computer • Transferring files between computers • Network diagnostics

  3. 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

  4. 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

  5. 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 low-level 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.

  6. 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.

  7. 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

  8. Some methods for UNIX access • Telnet • FTP • SSH • SFTP • No Machine

  9. Telnet • Client – Server application Telnet protocol Client (application on the machine you use) Server (application accepts instructions from client and returns data)

  10. 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?)

  11. 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)

  12. 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!

  13. 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

  14. SSH example

  15. 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.

  16. 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)

  17. 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

  18. 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!

  19. 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 mjj@marian.cs.nott.ac.uk • (OR use SSH Secure Copy, scp)

  20. 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

  21. 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

  22. 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.

  23. 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

  24. 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 . . .

  25. 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

  26. finger (Revisited) (2) • Finger can also be used to show information about a specific user: • finger zlizmj- look for a local user • finger mjj@marian.cs.nott.ac.uk- look for a remote user

  27. 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

  28. 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

  29. 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)

  30. 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

More Related