Logo

BCA Network Programming

bcasemester 6

Network Programming

Subject Code: CACS355

Course Title: Network Programming

Course No: CACS355

Nature of Course: Theory & Practical

Full Marks: 60+20+20

Pass Marks: 24+8+8

Credit Hours: 3

Course Description

This course is designed to extend students' knowledge and practice in analysis and design of computer networks by focusing on computer network programming. It includes introduction, Internet Address, URLs and URIs, HTTP, URLConnections, Socket Programming, IP Multicast and RMI. The JAVA programming language will be used throughout the course. It does not entirely focus on theoretical concept but also strongly focuses on practical skill based knowledge.

Course Objective

The general objectives of this course are to provide theoretical as well as practical knowledge of network programming to make students capable of developing, implementing, managing and troubleshooting the issues of network programming in their personal as well professional life.

Course Contents

Unit 1. Introduction   3 Hrs.

Network Programing Features and Scope, Network Programming Language, Tools & Platforms, Client and Server Applications, Client server model and software design

Unit 2. Internet Addresses   4 Hrs.

The InetAddress Class: Creating New InetAddress Objects, Getter, Methods, Address Types, Testing Reachability and Object Methods, Inet4Address and Inet6Address, The Network Interface Class: Factory Method & Getter Method, Some Useful Programs: SpamCheck, Processing Web Server Logfiles

Unit 3. URLs and URIs   5 Hrs.

URIs: URLs and Relative URLs, The URL Class: Creating New URLs, Retrieving Data From a URL, Splitting a URL into Pieces, Equality & Comparison and Conversion, The URI Class: Constructing a URI, The Parts of the URI, Resolving Relative URIs, Equality & Comparison and String Representation, x-www-form-urlencoded: URL Encoder and URL Decoder, Proxies: System Properties, The ProxyClass and The ProxySelector Class, Communicating with Server-Side Programs Through GET, Accessing Password-Protected Sites: The Authenticator Class, The PasswordAuthentication Class and The JPasswordField Class

Unit 4. HTTP   2 Hrs.

The protocol: Keep-Alive, HTTP Methods, The Request Body, Cookies: CookieManager and CookiesStore

Unit 5. URLConnections   5 Hrs.

Openning URLConnections, Reading Data from Server, Reading Header: Retrieving specific Header Fields and Retrieving Arbitrary Header Fields, Cache: Web Cache for Java, Configuring the Connection: protected URL url, protected boolean connected, protected boolean allowUserInteraction, protected boolean doInput, protected boolean doOutput, protected boolean ifModificationSince, protected boolean useCaches and Timeouts, Configuring the Client Request HTTP Header, Security Considerations for URLConnections, Guessing MIME Media Types, HttpURLConnection: The Request Methods, Disconnecting from the Server, Handling Server Responses, Proxies and Streaming Mode

Unit 6. Socket for Clients   5 Hrs.

Introduction to Socket, Using Sockets: Investigating Protocols with telnet, Reading from Servers with Sockets, Writing to Servers with Sockets, Constructing and connecting Sockets: Basic Constructors, Picking a Local Interface to Connect From, Constructing Without Connecting, Socket Addresses and Proxy Servers, Getting Information about a Socket: Closed or Connected?, toString(), Setting Socket Options: TCP_NODELAY, SO_LINGER, SO_TIMEOUT, SO_RCVBUF and SO_SNDBUF, SO_KEEPALIVE, OOBINLINE, SO_REUSEADDER and IP_TOS Class of Services, Socket in GUI Applications: Whois and A Network Client Library

Unit 7. Socket for Servers   5 Hrs.

Using ServerSockets: Serving Binary Data, Multithreaded Servers, Writing to Servers with Sockets and Closing Server Sockets, Logging: What to Log and How to Log, Constructing Server Sockets: Constructing Without Binding, Getting Information about Server Socket, Socket Options: SO_TIMEOUT, SO_RSUMEADDR, SO_RCVBUF and Class of Service, HTTP Servers: A Single File Server, A Redirector and A Full-Fledged HTTP Server

Unit 8. Secure Socket   4 Hrs.

Secure Communication, Creating Secure Client Sockets, Event Handlers, Session Management, Client Mode, Creating Secure Server Socket, Configure SSLServerSockets: Choosing the Cipher Suits, Session Management and Client Mode

Unit 9. Nonblocking I/O   3 Hrs.

An Example Client and Server, Buffers: Creating Buffers, Filling and Draining, Bulk Methods, Data Conversion, View Buffers, Compacting Buffers, Duplicating Buffers, Slicing Buffers, Marking and Resetting, Object Methods, Channels: SocketChannel, ServerSocketChannel, The Channels Class, Asynchronous Channels, Socket Options, Readiness Selection: The Selector Class, The SelectionKey Class

Unit 10. UDP   5 Hrs.

UDP Protocol, UDP Clients, UDP Servers, The DatagramPacket Class: The Constructor, The get Methods, The setter Methods, The DatagramSocket Class: The Constructor, Sending and Receiving Datagrams, Managing Connections, Socket Options: SO_TIMEOUT, SORCVBUF, SO_SNDBUF, SO_RSUMEADDR, SO_BROADCAST and IP_TOS, UDP Applications: Simple UDP Clients, UDPServer and A UDP Echo Client, DatagramChannel: Using DatagramChannel

Unit 11. IP Multicast   2 Hrs.

Multicasting: Multicast Address and Groups, Clients and Servers, Routers and Routing, Working with Multicast Sockets: The Constructor, Communicating with a Group

Unit 12. Remote Method Invocation (RMI)   2 Hrs.

Defining and Implementing RMI Service Interface, Creating an RMI Server and Client, Running the RMI System

Reference Books

  1. Elliotte Rusty Harold, "Java Network Programming", O'Reilly, 2014.
  2. Douglas E. Comer, David L. Stevens, "Internetworking with TCP_IP, Vol. III_ Client-Server Programming and Applications, Linux_Posix Sockets Version" Addison-Wesley, 2000.
  3. David Reilly, Michael Reilly, "Java Network Programming and Distributed Computing", Addison-Wesley Professional, 2002
  4. Kenneth L. Calvert, Michael J. Donahoo, "TCP-IP Sockets in Java. Practical Guide for Programmers", Morgan Kaufmann, 2008.
  5. Andrew S. Tanenbaum, David J. Wetherall, "Computer Networks, 5/e", Prentice Hall, 2011.
  6. Kurose, Ross, "Computer Networking: A Top-Down Approach", Pearson Education Limited, 2017.

Lab Works

Laboratory work should be done covering all the topics listed above and a small project work should be carried out using the concept learnt in this course using Java programming Language.