Friday, 13 July 2012

TCP/IP Protocol Suit 4e By B.A Frouzan

TCP/IP Protocol Suit by Behrouz A Frouzan 4th Edition is here to download from two different sites. I recomment mediaFire because its downloading speed is much higher than ziddu.

Download Link from MediaFire

Download MediaFire

Download Link from ziddu

Download ziddu


Friday, 29 June 2012

Important Concepts about Networking



Before moving to the network configuration part it is needed to discuss some important concepts about networking. I am sure that this post will clear and expose more about networking. 
Data Encapsulation: encapsulation is the process of wrapping data from upper layer data with that specific layer header & trailer. This creates PDU’s (Protocol Data Units) for that specific layer to interact with adjacent layers. Header & Trailers are specific for each layer like Data link layer adds sender receiver MAC addresses, Network layer adds IP addresses to each PDU. Adjacent layer interaction process occurs in the same computer. A specific layer provides services to its upper layer, & requests its lower layer for more functions add.

PDU:  Protocol Data Units are made through data encapsulation process. It consist specific layer (layer n) control information, & adjacent upper layer data encapsulated. Each layer has its own PDU, like L7PDU, L6PDU, L5PDU, L4PDU, L3PDU, L2PDU, and L1PDU. Same layer interaction occurs in two different networked systems on the same layer to communicate through its own header.
The below figure show about data encapsulation and PDU’s making process.
TCP PDUs & Encapsulation

Error Recovery: Error Recovery is the function of Transport layer for TCP protocol for reliable data transmission. Synchronous & Acknowledge bits are used for bits purpose. Figure below shows the TCP ACK & SEQ no without error recovery and with error. The figure A is without error means ACK not need for all received bytes to web server. Its only ACK for next data ACK 3.

TCP ACK with Error


In Figure B web browser does not receive seq 1 data. Since it ACK only seq 1, its means that web browser wants only seq 1 data to retransmit. Since web browser already received seq 2 data. It resembles data and sends it to upper layer. Now client only request for data ACK 3.
Positive Acknowledge & Retransmission: PAR used a timer to count the time when a sender sends a segment. Sender will automatically retransmit the segment if it does not receive the ACK at that time (time out). It helps in two cases as first if segment fails to receive at receiving end, & secondly if the Acknowledge is sends from receiver to sender but lost in the way.  With network security perspective it helps to avoid the “Denial of Services Attacks”.
Multiplexing: Multiplexing allows multiple connections to be established between processes in two end systems. Multiplexing is a feature that allows the transport layer at the receiving end to differentiate between the various connections and decide the appropriate application layer applications to hand over the received and reassembled data. The source and destination Port Number Fields in the TCP and UDP headers and a concept called socket are being used for this purpose.
Port numbers 0 – 1023 are well-known ports, port numbers 1024 – 49151 are registered ports, and port numbers 49152 – 65535 are private vendor assigned and dynamic ports. Below list shows some important Applications & their Port Number.

Application
Protocol
Port Number
HTTP
TCP
80
FTP
TCP
20 for Data, 21 for Control
Telnet
TCP
23
SMTP
TCP
25
POP3
TCP
110
DNS
TCP, UDP
53
TFTP
UDP
69
DHCP
UDP
67, 68
SNMP
UDP
161

Socket is a communication channel between two TCP processes. A client socket is created with IP address & destination Port number to connect to the server. A server is bind to a specified Port number & listens for incoming connections upon started a server application.

Checksum: is a test for ensuring the integrity of data or in simple words it is a test for error detection in packets. It is a number calculated from a sequence of mathematical functions. It is typically placed at the end of the data from which it is calculated, and then recalculated at the receiving end for verification.

Cyclical Redundancy Check: Discovers whether bit errors occurred during the transmission of a frame in Data Link Layer. This value is calculated with a mathematical formula applied to the data in the frame. a frame is discarded if the calculated value and the FCS value are mismatched. Error recovery is the responsibility of other protocols, like TCP Protocol of Transport Layer.

Straight-through cables: are used to connect PCs and routers to hubs or switches. When a PC sends data on pins 1 and 2, the hub receives the electrical signal on pins 1 and 2. Hubs and switches must think oppositely compared to PCs and routers in order to correctly receive data. This is related to the Physical Layer.

Crossover cables: are used to connect devices that use the same pair of pins for transmitting data, like hub to hub, switch to switch, hub to switch, PC to PC, and PC to router. Cables are selected in the Physical Layer.

Friday, 15 June 2012

Basic Router Configuration Commands

Introduction to Router Configuration



Cisco Router configuration is done by several methods. Some of the important methods are below:

  • Through TFTP Server over a Network
  • Through the Menu Interface provided at bootup
  • Through the Menu Interface provided by using the command setup
  •  Configuration from the IOS Command-line Interface
But here i used the method of Configuration from IOS CLI. becase it is common for all CISCO Routers,  and also it is important for CCNA, CCNP exam point of view.

Getting Started

From a terminal, one can probably configure router initially. If the router is already configured and at least one port configured with an IP address need to configure and physically connected to a network, then it will be configure through telnet. If the Router is not already configured so   it can be connect directly to the terminal and with a serial cable. this will be done through hyper terminal and a serial cable which one end must be connected to a serial port of PC and other to the console port of a route. Now on the router and start configuration. With a simulator software's (Packet Tracer, GNS3, NS2) it done directly as click double on the router and select the CLI mode.

Router>

It has been previously configured with a host-name, it will look like this: here Mohsin is the Router name/ Host-name

router > enable
router # host-name MOHSIN
MOHSIN #

If you want to start the initial configuration of the router or not. type yes or no.
There are three types of modes in Cisco routers. 
  • The User Mode
  • The Privileged Mode
  • The Configuration Mode
each mode has its own commands, to show each mode command type ? in that mode like

Mohsin> ? press enter

When first time enter to a router, that is the EXEC mode. some unprivileged commands are used here like show, ping, telnet etc.  From here enter to privileged mode through enable command, result is Privileged mode in # like 

Mohsin> enable
Mohsin #

When first enter to a router there is no idea of the initial configuration. since show  is used to check the initial configuration like.

Mohsin # show ? press enter will display all show configurations commands like
Mohsin # show interfaces
Mohsin # show ip protocols
Mohsin # show ipv6 protocols
Mohsin # show ip route
Mohsin # show ipv6 route
Mohsin # show ip arp
Mohsin # show ipv6 neighbors



Other Configuration Commands

Router > enable
Router #

The enable command enters you to the privileged mode. Now we are at the privileged mode (#). Now we can do every want to our host (router). Let us enter login password, allow 5 telenet connections to access this router at a time, set clock rate of the router.

Router # configure terminal
Router (config) # hostname MOHSIN
MOHSIN (config) # ctrn^z | end | exit
MOHSIN # clock set 12:10:30 13 July 2012
MOHSIN # show clock
MOHSIN # configure terminal
MOHSIN (config) # line console 0
MOHSIN (config-line) # logging synchronous

This command is used for preventing router from console messages to interrupting user input.

MOHSIN (config-line) # exec-timeout 0 0
MOHSIN (config-line) # exit
MOHSIN (config) # exit
MOHSIN #

This command is used for inactivity timeout, this is automatic session logout if there is no user activity. Timeout 0 0 means there is 0 minutes and 0 seconds, which means that never expires. Timeout 0 0 is also equivalent to # no exec-timeout
Now I discussed about the privileged mode access password method. This is done by two commands, access password & access secret. Remember that password command was used in the earlier versions of IOS. Password saved as a plain text, while secret is saved as encrypted, since secret is more secure than password & used in current versions of IOS. If both are enabled on a router the secret will be effective. We can see the password and secret by typing the # show running-config command.

MOHSIN # configure terminal
MOHSIN (config) # enable password cisco12345
MOHSIN (config) # enable secret cisco54321
MOHSIN (config) # end
MOHSIN # show running-config

Now I discuss about how to enable telnet/SSH session. In the below example password are created for the telnet session. VTY (Virtual Tely Type) are used for telnet.

MOHSIN # config terminal
MOHSIN (config) # line console 0
MOHSIN (config-line) # password cisco12345
MOHSIN (config-line) # login
MOHSIN (config-line) # line vty 0 3
MOHSIN (config-line) # password cisco12345
MOHSIN (config-line) # login
MOHSIN (config-line) # exit
MOHSIN (config) # exit
MOHSIN # exit
MOHSIN >

Here in the above example the first password is used for console login. And the second is used for telnet login. I kept both are same, but you can set these both different.