Network programing

  • View
    43

  • Download
    4

Embed Size (px)

DESCRIPTION

ftms

Text of Network programing

CN3044 Network Programming

Name Intake Contact Details

: : :

First Edition 2011 ISBN

Publish by FTMS Consultants (M) Sdn Bhd Kuala Lumpur, Malaysia

www.ftmsglobal.com Printed in Kuala Lumpur by FTMS Consultants (M) Sdn Bhd

All our rights reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of FTMS Consultants (M) Sdn Bhd.

We are grateful to the academic members and module experts for permission to produce the syllabus, teaching guide and study materials of which contribute to FTMS.

FTMS Consultants (M) Sdn Bhd 2011

ContentsPage1. 2. 3. 4. OSI LAYERS AND TCP/IP SUITE....................................................................................................22 5. NETWORK SETUP AND NETWORK COMMANDS....................................................................30 6. REVISION FOR JAVA........................................................................................................................44 7. EXERCISE FOR JAVA.......................................................................................................................53 8. PROCESS THREADING AND INTER-PROCESS..........................................................................55 9. CLIENT SERVER PROGRAMMING...............................................................................................66 10. MIDDLEWARE....................................................................................................................................73 11. TCP/IP PROGRAMMING..................................................................................................................82 12. NETWORK MODELING AND SIMULATION...............................................................................96 13. KERNEL PROGRAMMING.............................................................................................................101 14. NETWORK MANAGEMENT..........................................................................................................106 15. REVISION...........................................................................................................................................110 OVERVIEW............................................................................................................................................4 REVISION FOR OPERATING SYSTEM...........................................................................................6 REVISION FOR NETWORKING, INTERNET...............................................................................11

OverviewOverviewNormally UEL subject taught in FTMS KL do not have any guide books, thus the reason in 2011, Mr. Trevor wishes to have guide books for UEL students on UEL subjects. As such this exercise will be carry out term by term and the lecturers teaching the given subjects will need to update their respective guide book for that given term. And if all goes well by the end of the year all the books in FTMS will have been updated including UEL. Thus I, Sola Lee was allocated this subject Network Programming as I have been teaching this subject for two (2) terms now. CN3044 is a 3rd year subject and student have a prerequisite of SD2054 (Software Development) which in turn require SD1042 (Introduction to Software Development). The topics will initially revise basic concept like the operating system and networking and internet and the OSI seven (7) layers. Then the guide will briefly introduce the skills of setting up a simple network and windows network command commonly used networking. The main language used in this course will be Java as such the guide book will do a revision on Java which covers two (2) chapters even thought Java has been taught before in SD2054. The guide book will then discuss on process threading. Then the guide book will go into client server which will cover both web and socket programming. Then the guide book will continue briefly on middleware, TCP/IP programming, network modeling and network simulation.

Overview

Then the guide book will end with kernel programming and network management. ->

Chapter 01Revision for Operating System1. 2. 3. 4. 5. 6. 7. 8. Introduction Hardware Software Process Management Input and Output Management Storage Management Networking Security

Chapter 1- Operating System

Introduction to Operating System (OS)Introduction A computer can be divided into 2 main sections; the hardware and the software. The hardware is separated into input, process, output and storage. Each of the individual hardware has a BIOS (Basic Input Output System) used by the operating system (OS) to communicate with the devices. The user interacts with the application software (or any other software) which in turn interacts with the operating system and using the BIOS the operating system will interact with the hardware. User Application Software Software Operating System BIOS Utility Software Entertainment Software Etc

Hardware

Machine

An OS is set of software that runs on computers and manages all hardware and software activities in a computer. The physical appearance of the computer can be any from a hand phone to a super computer. All computers need to have an operating system that manages its activity and resources. Examples of OS are; Windows 7, Windows Vista, Windows XP, Macintosh, Linux Red Hat, UNIX, Solaris, etc

7/115

Chapter 1- Operating System

Regardless of the OS; they all perform the same set of roles. The following are the main role of an OS; 1. 2. 3. 4. 5. Process Management Input and Output Management Storage Management Networking Security

Process Management There are many processing running in a computer at the same time. This is called multi processing. The OS will manage and allocate memory and CPU time to each process. Input and Output Management There are devices connected to the computer and signals are constantly either coming in or going out of a computer. The OS dedicated a section of the memory for each device and control the incoming or outgoing signals to and from the devices. Storage Management There are two main storages in the computer; primary storage and the secondary storage. The primary storage is a short term memory a.k.a. RAM and it requires the present of electricity to keep the information intact. The secondary storage refers to any other long term storage that need not have electricity to store the information. They are devices like the hard disk, flash drive, CD or DVD, etc The file system such as FAT32, NTFS and many more are created and managed by the OS system to ensure data placed in a media are productive. The operating system also optimizes the secondary storage using technologies like virtual memory where unused space secondary storage can be converted for the use of the RAM. Networking Most OS now days come with network ability. Here the OS will have network features and setup such as IP address, sub-mask, gateway, etc.

8/115

Chapter 1- Operating System

Take note that networking can happen in the BIOS level without the presence of an OS by using physical or MAC address.

9/115

Chapter 1- Operating System

Security OS will handle two (2) types of security; prevention and contingency. Prevention security such as encryption, username and password, permission setting; (Read only, Write only, Execute only) are design to prevent something bad from happening. Contingency securities such as backup, partition recovery are design to recover when such bad things happen. ->

10/115

Chapter 02Revision for Networking, Internet1. 2. 3. 4. 5. 6. 7. 8. 9. Topology LAN/ MAN & WAN Protocols Open and Close System Server Operating System Network Architecture Network devices Internet/ Intranet & Extranet Internet Application

Chapter 2-Networking

Introduction to NetworkingComputer networking refers to the ability to join two (2) or more computers using some sort of media to enable the computers to exchange information. The advantages of network will be; 1. To share information and resources 2. Sharing resource will reduce cost 3. Sharing information will speed up processing. The disadvantages of network will be; 1. Increase the risk of data corruption and intrusion. 2. Information sharing will reduces privacy. It is important for a network person to understand how network are describe; for example the following phase: I have a client server LAN network running an intranet application on a Windows 2008 server. I have about 200 devices connected into a Ethernet network. Network computers can be describe in seven (7) ways; Topology, (Geographical factor) LAN/ MAN & WAN, Protocols, Type of System (Open or Close), Server Operating System and Network Architecture 1. Topology There are two (2) types of topology; Physical and Logical. Physical Topology simply refers to how computers physically connected in a network. There is basically four (4) different type of topology; The Star, Bus, Ring and Mesh. All other hybrid topology is a combination of the above topologies. For example a tree topology is a combination of a bus and star topology. Each topology has its own advantages and disadvantages. For example: The star topology is the easier, to setup and maintain but due to the connective nature of star, if entire network will be down if the central connection is down.

12/115

Chapter 2-Networking

Logical Topology refers to how data are transferred from 1 computer to another without regards to the physical topology. There are two types of logical topology; shared media and token based. In a shared media topology a.k.a. Ethernet N