1 / 28

Basic Network Concepts Review

Basic Network Concepts Review. SE 432 Software Engineering for Web Applications Dr. Ziad Al-Sharif. Network programming. Network programming is no longer the area of a few specialists. It has become a core part of every developer’s toolbox

switzer
Download Presentation

Basic Network Concepts Review

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. Basic Network ConceptsReview SE 432Software Engineering for Web Applications Dr. Ziad Al-Sharif

  2. Network programming • Network programming is no longer the area of a few specialists. • It has become a core part of every developer’s toolbox • This chapter covers the background networking concepts you need to understand before writing: • Server Side Programs and Java Based Dynamic Web Applications • General/History information can be found at: • https://en.wikipedia.org/wiki/ARPANET • https://www.internetsociety.org/internet

  3. Networks • A network is a collection of computers and other devices that can send data to and receive data from one another • more or less in real time • Each machine on a network is called a node • Most nodes are computers: • but it can be printers, routers, bridges, gateways, etc. • Every network node has an address: • a sequence of bytes that uniquely identifies it (IP Address) • Internet addresses are normally assigned to a computer by the organization that is responsible for it • Called the Internet Service Provider (ISP)

  4. ISPs • ISPs get their IP addresses from one of the regional Internet registries such as: • the registry for North America is ARIN: • the American Registry for Internet Numbers • which are in turn assigned IP addresses by the Internet Corporation for Assigned Names and Numbers (ICANN). https://www.icann.org/resources

  5. Modern Computer Networks • All modern computer networks are packet-switchednetworks: • data traveling on the network is broken into chunks called packetsand each packet is handled separately • Each packet contains information about who sent it and whereit is going • The most important advantage of breaking data into individually addressed packets is that • packets from many ongoing exchanges can travel on one wire, • which makes it much cheaper to build a network • many computers can share the same wire without interfering • Another advantage of packets is that checksums can be used to detect whether a packet was damaged in transit (data validation)

  6. Network Protocols • It provides a setof rules defining how computers communicate: • the format of addresses, how data is split into packets, etc. • There are many different protocols defining different aspects of network communication • For example: • HyperTextTransfer Protocol (HTTP) defines how web browsers and servers communicate • the IEEE 802.3 standard defines a protocol for how bits are encoded as electrical signals on a particular type of wire • Open, published protocol standards allow software and equipment from different vendors to communicate with one another. • i.e. A web server doesn’t care whether the client is a Windows Machine, Unix workstation, an Android phone, or an iPad, because all clients speak the same HTTP protocol regardless of platform.

  7. A stack of possible protocols that may exist in your network.

  8. The Layers of a Network • Sending data across a network is a complex operation • It must be carefully tuned to the physical characteristics of the network as well as the logical character of the data being sent. • Software that sends data across a network must understand: • how to avoid collisions between packets, • convert digital data to analog signals, • detect and correct errors, • route packets from one host to another, and more. • Different aspects of network communication are separated into multiple layers. • Each layer represents a different level of abstraction between the physical hardware (i.e., the wires and electricity) and the information being transmitted.

  9. Layer Models • There are several different Layer Models • For example, the standard TCP/IP four-layer model appropriate for the Internet • applications like Firefoxrun in the application layer and talksonly to the transport layer. • The transport layer talks only to the application layer and the Internet layer. • The Internet layer in turn talks only to the host-to-network layer and the transport layer, never directly to the application layer. • The host-to-network layer moves the data across the wires, fiber-optic cables, or other medium to the host-to-network layer on the remote system, which then moves the data up the layers to the application on the remote system.

  10. TCP/IP Four-Layer Model

  11. Open Systems Interconnection (OSI) Application Level Host-to-NetworkIn the TCP/IP model

  12. OSI and TCP/IP Models LAYER 7 6 5 4 3 2 1 OSI: Open Systems Interconnection model created by ISO. • Application Layer : handles the details of the particular application • Transport Layer : provides a reliable flow of data between two hosts • Internet Layer : handles the movement of packets, i.e. Routing • Network Layer : includes device driver and network interface card HTTP, Telnet, FTP, TFTP, SNMP, DNS, SMTP TCP, UDP, RTP IP, ICMP, ARP, RARP  Ethernet, Token Ring, FDDI, X.25 , Frame Relay, RS-232, v.35

  13. The Application Layer • This layer receives/delivers data to the user • Decides what to do with the data after it’s transferred • i.e. an application protocol like HTTP (for World Wide Web) makes sure that your web browser displays a graphic image as a picture, not a long stream of numbers. • Other application layer protocols examples: • SMTP, POP, and IMAP for email; • FTP, FSP, and TFTP for file transfer; • the Session Initiation Protocol (SIP) and Skype for voice communication, etc. • It is where most of the network parts of your programs spend their time • The three lower layers (transport, internet, and host-to-network) • all work together to define how data is transferred from one computer to another

  14. Packet Encapsulation • The data is sent down the protocol stack • Each layer adds to the data by prepending headers

  15. The Transport Layer • IP networks adds an additional header to each datagram/packetthat contains more information. • There are two primary protocols (that are built on top of IP) • Transmission Control Protocol (TCP) • allows for retransmission of lost or corrupted data and delivery of bytes in the order they were sent (packets). • TCP is called a reliable protocol; • User Datagram Protocol (UDP): • allows the receiver to detect corrupted packets but does not guarantee that packets are delivered in the correct order (or at all). However, UDP is often much (often in this protocol packets are called datagrams) • UDP is an unreliable protocol

  16. Example • When a web browser sends a request to a web server to retrieve a page • the browser is actually talking to the transport layer on the local client machine. • Then transport layer breaks the request into TCPsegments, and adds some sequence numbers and checksums to the data, and then passes the request to the local internet layer. • Then internet layerfragments the segments into IP datagrams of the necessary size for the local network and passes them to the host-to-network layer for transmission onto the wire. • Then host-to-network layer encodes the digital data as analog signals appropriate for the particular physical medium and sends the request out the wire where it will be read by the host-to-network layer of the remote system to which it’s addressed.

  17. IP Addresses and Domain Names • IP Addresses: Every computer connected to the Internet is identified by a unique string, known as its Internet Protocol (IP) address. • The IPv4 address consists of 4 numbers (each 0-255) separated by periods. • e.g., 18.72.0.3. It is 32-bit numeric address is written in decimal as four numbers separated by periods • IPv6 addresses are 128-bit IP address written in hexadecimal and separated by colons. • An example IPv6 address could be written like this:3ffe:1900:4545:3:200:f8ff:fe21:67cf • http://www.linksys.com/us/support-article?articleNum=139604 • Host Names and Domain Names • Since IP addresses are difficult to remember, the Internet also allows you to specify a computer by a name rather than a number string. e.g. just.edu.jo • Domain Name Service (DNS) • The mapping of host names to IP addresses is handled through a service called Domain Name Service (DNS). 

  18. Network Address Translation • Because of the increasing scarcity and demand for raw IP addresses, most networks today use Network Address Translation (NAT). • In NAT-based networks most nodes only have local, non-routable addresses selected from either 10.x.x.x, 172.16.x.xto 172.31.x.x, or 192.168.x.x. • i.e. most of the machines in our University Labs are not accessible from outside of our JUST LAN • The nodes in our SE Lab all share a single externally visible IP address. • The routers that connect the local networks to the ISP translate these local addresses into a much smaller set of routable addresses.

  19. DNS • nslookup program provides command-line access to DNS (on most systems) • looking up a host name given an IP address is known as a reverse lookup • Recall that single host may have multiple IP addresses. • Address returned is the canonical IP address specified in the DNS system. • ipconfig (on Windows) can be used to find the IP address (addresses) of your machine (ifconfig on Linux) • ipconfig /displaydns displays the contents of the DNS Resolver Cache (ipconfig /flushdns to flush it) Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides

  20. Try out ipconfigcommand • Try out the nslookup command • What about ping command

  21. AddressingProcesses • identifierincludes both IP address and port numbers associated with process on host. • example port numbers: • HTTP server: 80 • mail server: 25 • to send HTTP message to just.edu.jo web server: • IP address:128.119.245.12 • port number:80 • to receive messages, a process must have an identifier • host device has unique IP address • Q: does IP address of host on which process runs suffice for identifying the process? • A: no, many processes can be running on the same host

  22. Ports • IP Addresses would be all you needed if each computer did no more than one thing at a time. • However, modern computers do many different things at once. • Each computer with an IP address has several thousand logical ports • (65,535 per transport layer protocol, to be precise). • Each port is identified by a number between 1 and 65535. • For example, • HTTP, the underlying protocol of the Web, commonly uses port80. • We say that a Web Server listenson port 80 for incoming connections. • When data is sent to a web server on a particular machine at a particular IP address, it is also sent to a particular port (usually port 80) on that machine • Port numbers between 1 and 1023 are reserved for well-known services like finger, FTP, HTTP, and IMAP, etc. • On Unix systems, including Linux and Mac OS X, only programs running as root can receive data from these ports, but all programs may send data to them. • On Windows, any program may use these ports without special privileges

  23. Examples of Well-Known Ports

  24. Client Server Connections

  25. Client Server Connections

  26. Sockets • If you are programming a client, then you would open a socket like this: • If you are programming a server, then this is how you open a socket: Socket MyClient; try{ MyClient=newSocket("Machine name",PortNumber); }catch(IOException e){ System.out.println(e); } ServerSocketMyService; try{ MyServerice=newServerSocket(PortNumber); }catch(IOException e){ System.out.println(e); } HTTP:

More Related