Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 16 Writing a Network Application.

Slides:



Advertisements
Similar presentations
CCNA – Network Fundamentals
Advertisements

Chapter 7: Transport Layer
1 Linux Networking and Security Chapter 2. 2 Configuring Basic Networking Describe how networking devices differ from other Linux devices Configure Linux.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.1 Troubleshooting Working at a Small-to-Medium Business or ISP – Chapter 9.
Network Programming Chapter 11 Lecture 6. Networks.
Socket Programming.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
1 Java Networking – Part I CS , Spring 2008/9.
CS3771 Today: network programming with sockets  Previous class: network structures, protocols  Next: network programming Sockets (low-level API) TODAY!
Understanding Networks. Objectives Compare client and network operating systems Learn about local area network technologies, including Ethernet, Token.
Introduction To Networking
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
© Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 1 Let’s get started. Let’s start by selecting an architecture from among.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
I NTRODUCTION OF S OCKET P ROGRAMMING L.Aseel AlTurki King Saud University.
TCP/IP Tools Lesson 5. Objectives Skills/ConceptsObjective Domain Description Objective Domain Number Using basic TCP/IP commands Understanding TCP/IP3.6.
Lecture slides prepared for “Business Data Communications”, 7/e, by William Stallings and Tom Case, Chapter 8 “TCP/IP”.
Process-to-Process Delivery:
INTRODUCTION TO WEB DATABASE PROGRAMMING
NETWORK CENTRIC COMPUTING (With included EMBEDDED SYSTEMS)
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CHAPTER 2 PCs on the Internet Suraya Alias. The TCP/IP Suite of Protocols Internet applications – client/server applications The client requested data.
Hands-On Microsoft Windows Server 2003 Networking Chapter Three TCP/IP Architecture.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 12 Electronic Mail.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network Chapter 3: TCP/IP Architecture.
NetworkProtocols. Objectives Identify characteristics of TCP/IP, IPX/SPX, NetBIOS, and AppleTalk Understand position of network protocols in OSI Model.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 19 PCs on the Internet.
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 7: Transport Layer Introduction to Networking.
IP and Errors IP Best Effort Datagrams can be: –Lost –Delayed –Duplicated –Delivered out of order –Corrupted.
1 Computer Networks DA Chapter 1-3 Introduction.
Chapter 7 Low-Level Protocols
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 2: TCP/IP Architecture.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
Linux+ Guide to Linux Certification Chapter Fifteen Linux Networking.
Linux+ Guide to Linux Certification, Second Edition Chapter 14 Network Configuration.
TCP/IP TCP/IP LAYERED PROTOCOL TCP/IP'S APPLICATION LAYER TRANSPORT LAYER NETWORK LAYER NETWORK ACCESS LAYER (DATA LINK LAYER)
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
Application Layer Khondaker Abdullah-Al-Mamun Lecturer, CSE Instructor, CNAP AUST.
Chapter 2 Applications and Layered Architectures Sockets.
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
TCP/IP Honolulu Community College Cisco Academy Training Center Semester 2 Version 2.1.
Application Block Diagram III. SOFTWARE PLATFORM Figure above shows a network protocol stack for a computer that connects to an Ethernet network and.
1 Chapter 28 Networking. 2 Objectives F To comprehend socket-based communication in Java (§28.2). F To understand client/server computing (§28.2). F To.
Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 13 FTP and Telnet.
Transport Layer COM211 Communications and Networks CDA College Theodoros Christophides
The InetAddress Class A class for storing and managing internet addresses (both as IP numbers and as names). The are no constructors but “class factory”
Data Communications and Networks
Java Programming: Advanced Topics 1 Networking Programming Chapter 11.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network, Enhanced Chapter 3: TCP/IP Architecture.
1 Bus topology network. 2 Data is sent to all computers, but only the destination computer accepts 02608c
Linux Operations and Administration Chapter Eight Network Communications.
CSI 3125, Preliminaries, page 1 Networking. CSI 3125, Preliminaries, page 2 Networking A network represents interconnection of computers that is capable.
Berkeley Socket Abstraction
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The OSI Model. Understanding the OSI Model In early 1980s, manufacturers began to standardize networking so that networks from different manufacturers.
Client-server communication Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
1 K. Salah Application Layer Module K. Salah Network layer duties.
Network Programming. These days almost all devices.
IST 201 Chapter 11 Lecture 2. Ports Used by TCP & UDP Keep track of different types of transmissions crossing the network simultaneously. Combination.
SOCKET PROGRAMMING Presented By : Divya Sharma.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Chapter Objectives In this chapter, you will learn:
MCA – 405 Elective –I (A) Java Programming & Technology
Chapter 6: Network Layer
Chapter 3: Windows7 Part 4.
Process-to-Process Delivery:
Chapter 7 Network Applications
Computer Networks DA2402.
Process-to-Process Delivery: UDP, TCP
Presentation transcript:

Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 16 Writing a Network Application

Computer Networking From LANs to WANs: Hardware, Software, and Security2 Objectives Discuss the client-server model Explain the basic features of a socket Summarize the various network programming languages Show examples of both connectionless and connection-oriented network applications

Computer Networking From LANs to WANs: Hardware, Software, and Security3 Client-Server Model Client –Sends message to request server service –Message encapsulated inside a network packet Transmitted over physical connection Server –Responds to client using a message Contains client's desired information Takes other appropriate action Client-server messages –Text based or data

Computer Networking From LANs to WANs: Hardware, Software, and Security4 Client-Server Model (cont’d.) Figure 16-1 Client-server network model

Connection-Oriented Versus Connectionless Communication Connection-oriented communication –Requires an established client-server session Connectionless communication –Client and server hope messages arrive correctly Application not severely affected if delivery is lost or corrupted –Eliminates session overhead Important when speed is an application consideration –Eliminates overkill of setting up a session Useful for small number of exchanged messages Computer Networking From LANs to WANs: Hardware, Software, and Security5

6 Connection-Oriented Versus Connectionless Communication (cont’d.) Table 16-1 Communication types

Computer Networking From LANs to WANs: Hardware, Software, and Security7 Sockets Input/output mechanism for network messages –Used by every network application to communicate Windows Sockets Application Programming Interface (Winsock API) –Initialization performed automatically –Uses single WSAStartup function call

Computer Networking From LANs to WANs: Hardware, Software, and Security8 Sockets (cont’d.) Winsock API (cont’d.) –Create Windows environment TCP socket type Use IPPROTO_TCP –Create Windows environment UDP socket Use the socket() function

Computer Networking From LANs to WANs: Hardware, Software, and Security9 Sockets (cont’d.) Blocking mode (default) –Program stops and waits for a received packet Nonblocking mode –Program does not stop and wait for new packet arrival Change socket mode

Computer Networking From LANs to WANs: Hardware, Software, and Security10 Sockets (cont’d.) Client sockets and server sockets require slightly different initialization Client initialization code

Computer Networking From LANs to WANs: Hardware, Software, and Security11 Sockets (cont’d.) Server initialization code –Server must bind address information to the socket IP address and socket port number used to uniquely identify socket –If another application already using the same port bind() function will discover it

Sockets (cont’d.) Session oriented (TCP) socket communication –Server calls the listen() function, waits for connection –Client calls the connect() function, initiates a session Acknowledged by server function accept() –Functions send() and recv() used by both the client and server to exchange messages Connectionless (UDP) communication –After address structure initialization Client and server simply exchange messages using the sendto() and recvfrom() functions Close socket with closesocket(), WSACleanup() Computer Networking From LANs to WANs: Hardware, Software, and Security12

Computer Networking From LANs to WANs: Hardware, Software, and Security13 Figure 16-3 Client Server Connectionless (UDP) communication

Computer Networking From LANs to WANs: Hardware, Software, and Security14 Sockets (cont’d.) Table 16-2 Winsock functions

Computer Networking From LANs to WANs: Hardware, Software, and Security15 Network Programming Languages C/C++ –Supports connectionless, connection-oriented communications –Anyone with a C/C++ compiler and networking library can develop network applications C# –Eliminates C++ program complexity –Provides C++ programming flexibility –Provides Visual Basic visual features

Computer Networking From LANs to WANs: Hardware, Software, and Security16 Network Programming Languages (cont’d.) Visual Basic –Compiled executable programs and scripts –IIS Applications Server applications Compiled application receives and processes service requests from a Web browser –DHTML Applications Client applications Interface directly with the browser

Network Programming Languages (cont’d.) Practical Extraction and Reporting Language (Perl) –Interpreted language useful for CGI applications –Perl programs are called scripts Not precompiled; stored in binary form Processed upon demand Easily ported to other computing environments Host machine must provide a Perl interpreter –Works with text and binary files –Equipped with standard programming elements Conditional statements, arithmetic and logical operations, loops, and subroutines Computer Networking From LANs to WANs: Hardware, Software, and Security17

Computer Networking From LANs to WANs: Hardware, Software, and Security18 Network Programming Languages (cont’d.) Java –Uses applets Transferred from server to browser client Executed on a Java virtual machine contained within the browser –Supports stream (TCP) and datagram (UDP) sockets Through java.net package –Remote method invocation (RMI) Provides additional networking capabilities Allows distributed Java objects to communicate with each other

Computer Networking From LANs to WANs: Hardware, Software, and Security19 Network Applications All available on companion CD –Sample executions –Messages passed between the client and server in each case Echo server –Connectionless application Returns same message back to the client –ECHOSRVR Must be started first with user-supplied port number –ECHOCLNT Displays greeting, asks for message to send

Computer Networking From LANs to WANs: Hardware, Software, and Security20 Network Applications (cont’d.) Time server –Connectionless application Replies to a client message with current time and date message –TIMESRVR: server application Must be started with user-supplied port number –TIMECLNT: time client Must be started with server address and the same port number

Computer Networking From LANs to WANs: Hardware, Software, and Security21 Network Applications (cont’d.) Tic-Tac-Toe –UDP datagrams exchange game information –Server responsibilities: Checking legality of client’s move Making its own countermove Testing for win, lose, tie after each move

Computer Networking From LANs to WANs: Hardware, Software, and Security22 Network Applications (cont’d.) Chat server –Chat Server and Chat Client programs Implements client-server architecture –Chat Client Sends message to the server Displays any message from the server –Chat Server Waits for client message Sends any received message to all clients –Chat Server must be running: Before Chat Client can connect

Computer Networking From LANs to WANs: Hardware, Software, and Security23 Network Applications (cont’d.) NETMAZE –Most complex of all client-server examples –Contains both client code and server code Uses command line parameters to enter one mode or the other –Should be run on newer computer system DirectX package must be installed –Goal Walk around the maze and find the exit

Computer Networking From LANs to WANs: Hardware, Software, and Security24 Network Applications (cont’d.) CGI IP Address Calculator –IPCLASS version Uses data POSTed from the FORM element to generate text-only output back to the browser –IPCLASS2 version Returns HTML output Allows WYSIWYG formatting

Network Appliances IRP device –Operates using UDP –Special features: Scenix SX52BD micro-controller RealTek RTL8019AS full-duplex Ethernet controller ARP, IP, ICMP, UDP, and DHCP protocol support Two activity indicator LEDs 24 pins of programmable input/output Various input options (TTL, CMOS levels, Schmitt- Trigger inputs or internal pull-up resistors) Utility program for configuring the module and for manually reading and writing to the ports Computer Networking From LANs to WANs: Hardware, Software, and Security25

Computer Networking From LANs to WANs: Hardware, Software, and Security26 Network Appliances (cont’d.) IPS device –Operates using TCP –Special features: Scenix SX52BD micro-controller RealTek RTL8019AS full-duplex Ethernet controller Web server 512 KB of flash memory 16 digital inputs 16 digital outputs 32 digital I/O channels all TTL compatible

Computer Networking From LANs to WANs: Hardware, Software, and Security27 Network Appliances (cont’d.) LS100 –Operates using TCP –Special features: Connect serial devices to an Ethernet network Support for RS232 serial devices using a DB9 connector Serial transfer rate up to 115Kbps Configuration via telnet or serial port Support for ARP, IP/ICMP, TCP/IP, Telnet, DHCP client, and PPPoE protocols

Computer Networking From LANs to WANs: Hardware, Software, and Security28 Figure Network Programming Environment Network Appliances (cont’d.) Interfacing –On-line lab environment Programmer on the Internet can connect to a device and operate it remotely Several students can work at the same time

Troubleshooting Techniques Never make assumptions –Test connections to make sure machines communicate If there is too much delay in client-server connection –Examine path between client and server Verify TCP/IP protocol installed properly and bound to network adapter Verify problem is not operating system-related Check for correct Winsock version number, IP address, and port number Computer Networking From LANs to WANs: Hardware, Software, and Security29

Summary Client server model communication –Client request service –Server responds with information or other action Connection-oriented communication –Requires established client and server session Connectionless communication –Eliminates session overhead Socket: input/output mechanism for network messages Many popular programming languages support networking Computer Networking From LANs to WANs: Hardware, Software, and Security30