html5-img
1 / 94

Advanced Programming

Advanced Programming. Rabie A. Ramadan Lecture 3. Network Programming An Overview. A computer network is an interconnected collection of autonomous computers. Computer Network. A topology is a way of “ laying out” the network. Topologies can be either physical or logical .

snow
Download Presentation

Advanced Programming

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. Advanced Programming Rabie A. Ramadan Lecture 3

  2. Network Programming An Overview

  3. A computer networkis an interconnected collection of autonomous computers. Computer Network

  4. A topologyis a way of “laying out” the network. Topologies can be either physical or logical. Physical topologies describe how the cables are run. Logical topologies describe how the network messagestravel Network topology

  5. Bus (can be both logical and physical) Star (physical only) Ring (can be both logical and physical) Mesh (can be both logical and physical) Network topology (cont.)

  6. Bus A bus is the simplest physical topology. It consists of a single cable that runs to every workstation This topology uses the least amount of cabling, but also covers the shortest amount of distance. Network topology (cont.)

  7. It is difficult to add a workstation Have to completely reroute the cable and possibly run two additional lengths of it. If any one of the cables breaks, the entire network is disrupted. Therefore, it is very expensive to maintain. Network topology (cont.)

  8. Star Topology A physical star topology branches each network device off a central device called a hub, making it very easy to add a new workstation. Also, if any workstation goes down it does not affect the entire network. Network topology (cont.)

  9. Star topologies are more expensive to install than bus networks, There are several more cables that need to be installed, plus the cost of the hubs that are needed. Network topology (cont.)

  10. Ring Each computer connects to two other computers, joining them in a circle creating a unidirectional path where messages move workstation to workstation. Network topology (cont.)

  11. The ring makes it difficult to add new computers. Unlike a star topology network, the ring topology network will go down if one entity is removed from the ring. Physical ring topology systems don’t exist much anymore, mainly because the hardware involved was fairly expensive and the fault tolerance was very low. Network topology (cont.)

  12. Mesh The mesh topology is the simplest logical topology in terms of data flow, but it is the most complex in terms of physical design. In this physical topology, each device is connected to every other device Network topology (cont.)

  13. The physical mesh topology is very expensive to install and maintain. Cables must be run from each device to every other device. The advantage you gain from it is its high fault tolerance. There will alwaysbe a way of getting the data from source to destination. Network topology (cont.)

  14. Advantages and Disadvantages of Network Topologies Network topology (cont.)

  15. A network includes: Special purpose hardware devices that: Interconnect transmission media Control transmission of data Run protocol software Protocol software that: Encodes and formats data Detects and corrects problems encountered during transmission Computer Network

  16. Address: byte-string that identifies a node usually unique Routing: process of forwarding messages to the destination node based on its address Types of addresses unicast: node-specific broadcast: all nodes on the network multicast: some subset of nodes on the network Addressing and Routing

  17. IP Addresses and Classes IPv6 addresses have a size of 128 bits

  18. IP Addresses and Classes

  19. IP Addresses and Classes

  20. IP Addresses and Classes

  21. Subnet Mask

  22. A network architectureis a set of layers and protocols used to reduce network design complexity. The TCP/IP Protocol Suite (also called the Internet Architecture) is an important example of a network architecture. The OSI (Open Systems Interconnection) 7-Layer Reference Model [ISO,1984] is a guide that specifies what each layer should do, but not how each layer is implemented. Network Architecture

  23. ISO/OSI Reference Model

  24. ISO 7-Layer Reference Model End host End host Application Application Presentation Presentation Session Session Transport Transport Network Network Network Network Data link Data link Data link Data link Physical Physical Physical Physical One or more nodes within the network

  25. TCP/IP Model

  26. Internet Model

  27. A protocol is a set of rules of communication. Protocols are the building blocks of a network architecture. Term “protocol” is overloaded specification of peer-to-peer interface module that implements this interface Protocols

  28. A network allows arbitrary applications to communicate. However, a network programmer doesn’t need to know the details of all lower-level network technologies. Network facilities are accessed through an Application Programming Interface (API); e.g., a Service Interface. Network Programming

  29. Most network applications can be divided into two pieces: a client and a server. A Web browser (a client) communicate with a Web server. A Telnet client that we use to log in to a remote host. A user who needs access to data located at remote server. Basic Paradigm for Communication

  30. Establish contact (connection). Exchange information (bi-directional). Terminate contact. Basic Paradigm for Communication

  31. Server waits for client to request a connection. Client contacts server to establish a connection. Client sends request. Server sends reply. Client and/or server terminate connection. Client-Server Paradigm

  32. Connection-oriented Setup the link before communication. Similar to the phone call. We need the phone number and receiver. Connectionless No link needed to be set up before communication. Similar to send a letter. We need the address and receiver. Two types of Communication

  33. TCP (Transmission Control Protocol) is a connection-oriented protocol. UDP (User Datagram Protocol) is connectionless (UDP) protocol. TCP and UDP

  34. Identifying the ultimate destination IP addresses identify hosts Host has many applications Ports (16-bit identifier) Ports Application WWW E-mail Telnet Port 80 25 23 192.18.22.13

  35. A socket is defined as an endpoint for communication. Concatenation of IP address and port A socket pair (local IP address, local port, foreign IP address, foreign port) uniquely identifies a communication. The socket 161.25.19.8:1625 refers to port 1625 on host 161.25.19.8 Sockets

  36. Sockets

  37. agreed port any port socket socket message client server other ports Internet address = 138.37.94.248 Internet address = 138.37.88.249 Sockets and Ports

  38. TCP Socket Bind() binds the socket to the specified address. The address parameter specifies the local component of the address, e.g. IP address and UDP/TCP port

  39. UDP Socket

  40. Steps in creating Clients in Java What is the difference between String and BufferedReader?

  41. Steps in Creating Clients in Java

More Related