Thursday, June 12, 2008

FTP and NAT devices

The representation of the IPs and ports in the PORT command and PASV reply poses another challenge for NAT devices in handling FTP. The NAT device must alter these values, so that they contain the IP of the NAT-ed client, and a port chosen by the NAT device for the data connection. The new IP and port will probably differ in length in their decimal representation from the original IP and port. This means that altering the values on the control connection by the NAT device must be done carefully, changing the TCP and Acknowledgment fields for all subsequent packets.

For example: A client with an IP of 192.168.0.1, starting an active mode transfer on port 1025, will send the string "PORT 192,168,0,1,4,1". A NAT device masquerading this client with an IP of 192.168.15.5, with a chosen port of 2000 for the data connection, will need to replace the above string with "PORT 192,168,15,5,7,208".

The new string is 23 characters long, compared to 20 characters in the original packet. The Acknowledgment field by the server to this packet will need to be decreased by 3 bytes by the NAT device for the client to correctly understand that the PORT command has arrived to the server. If the NAT device is not capable of correcting the Sequence and Acknowledgement fields, it will not be possible to use active mode FTP. Passive mode FTP will work in this case, because the information about the IP and port for the data connection is sent by the server, which doesn't need to be NATed. If NAT is performed on the server by the NAT device, then the exact opposite will happen. Active mode will work, but passive mode will fail.

It should be noted that many NAT devices perform this protocol inspection and modify the PORT command without being explicitly told to do so by the user. This can lead to several problems. First of all, there is no guarantee that the used protocol really is FTP, or it might use some extension not understood by the NAT device. One example would be an SSL secured FTP connection. Due to the encryption, the NAT device will be unable to modify the address. As result, active mode transfers will fail only if encryption is used, much to the confusion of the user.

The proper way to solve this is to tell the client which IP address and ports to use for active mode. Furthermore, the NAT device has to be configured to forward the selected range of ports to the client's machine.

FTP and web browsers

Most recent web browsers and file managers can connect to FTP servers, although they may lack the support for protocol extensions such as FTPS. This allows manipulation of remote files over FTP through an interface similar to that used for local files. This is done via an FTP URL, which takes the form ftp(s)://<ftpserveraddress> (e.g., ftp://ftp.gimp.org/). A password can optionally be given in the URL, e.g.: ftp(s)://<login>:<password>@<ftpserveraddress>:<port>. Most web-browsers require the use of passive mode FTP, which not all FTP servers are capable of handling. Some browsers allow only the downloading of files, but offer no way to upload files to the server

FTP return codes

FTP server return codes indicate their status by the digits within them. A brief explanation of various digits' meanings are given below:

  • 1xx: Positive Preliminary reply. The action requested is being initiated but there will be another reply before it begins.
  • 2xx: Positive Completion reply. The action requested has been completed. The client may now issue a new command.
  • 3xx: Positive Intermediate reply. The command was successful, but a further command is required before the server can act upon the request.
  • 4xx: Transient Negative Completion reply. The command was not successful, but the client is free to try the command again as the failure is only temporary.
  • 5xx: Permanent Negative Completion reply. The command was not successful and the client should not attempt to repeat it again.
  • x0x: The failure was due to syntax error.
  • x1x: This response is a reply to a request for information.
  • x2x: This response is a reply relating to connection information.
  • x3x: This response is a reply relating to accounting and authorization.
  • x4x: Unspecified as yet
  • x5x: These responses indicate the status of the Server file system vis-a-vis the requested

Securtity Problems

The original FTP specification is an inherently insecure method of transferring files because there is no method specified for transferring data in an encrypted fashion. This means that under most network configurations, user names, passwords, FTP commands and transferred files can be "sniffed" or viewed by anyone on the same network using a packet sniffer. This is a problem common to many Internet protocol specifications written prior to the creation of SSL such as HTTP, SMTP and TELNET. The common solution to this problem is to use either the SFTP (SSH File Transfer Protocol), or FTPS(FTP over SSl), which adds SSL to FTP as specified in RFC 2417


Criticisms of FTP

  • Passwords and file contents are sent in clear text, which can be intercepted by eavesdroppers. There are protocol enhancements that circumvent this, for instance by using SSL, TLS or kerberos.
  • Multiple TCP/IP connections are used, one for the control connection, and one for each download, upload, or directory listing. Firewalls may need additional logic and or configuration changes to account for these connections.
  • It is hard to filter active mode FTP traffic on the client side by using a firewall, since the client must open an arbitrary the portin order to receive the connection. This problem is largely resolved by using passive mode FTP.
  • It is possible to abuse the protocol's built-in proxy features to tell a server to send data to an arbitrary port of a third computer; see FXP.
  • FTP is a high latency protocol due to the number of commands needed to initiate a transfer.
  • No integrity check on the receiver side. If a transfer is interrupted, the receiver has no way to know if the received file is complete or not. Some servers support extensions to calculate for example a file's , however even then the client has to make explicit use of them. In the absence of such extensions, integrity checks have to be managed externally.
  • No date/timestamp attribute transfer. Uploaded files are given a new current timestamp, unlike other file transfer protocols such as SFTP, which allow attributes to be included. There is no way in the standard FTP protocol to set the time-last-modified (or time-created) datestamp that most modern filesystems preserve. There is a draft of a proposed extension that adds new commands for this, but as of yet, most of the popular FTP servers do not support it.

Connection methods of FTP


FTP runs exclusively over TCP. FTP servers by default listen on the port 21 for incoming connections from FTP clients. A connection to this port from the FTP Client forms the control stream on which commands are passed to the FTP server from the FTP client and on occasion from the FTP server to the FTP client. FTP uses the out-of -band control which means it uses a separate connection for control and data. Thus, for the actual file transfer to take place, a different connection is required which is called the data stream. Depending on the transfer mode, the process of setting up the data stream is different.

In active mode, the FTP client opens the Dynamic Port (49152–65535), sends the FTP server the dynamic port number on which it is listening over the control stream and waits for a connection from the FTP server. When the FTP server initiates the data connection to the FTP client it binds the source port to port 20 on the FTP server.

In order to use active mode, the client sends a PORT command, with the IP and port as argument. The format for the IP and port is "h1,h2,h3,h4,p1,p2". Each field is a decimal representation of 8 bits of the host IP, followed by the chosen data port. For example, a client with an IP of 192.168.0.1, listening on port 49154 for the data connection will send the command "PORT 192,168,0,1,192,2". The port fields should be interpreted as p1×256 + p2 = port, or, in this example, 192×256 + 2 = 49154.

In passive mode, the FTP server opens a dynamic port (49152–65535), sends the FTP client the server's IP address to connect to and the port on which it is listening (a 16 bit value broken into a high and low byte, like explained before) over the control stream and waits for a connection from the FTP client. In this case the FTP client binds the source port of the connection to a dynamic port between 49152 and 65535.

To use passive mode, the client sends the PASV command to which the server would reply with something similar to "227 Entering Passive Mode (127,0,0,1,192,52)". The syntax of the IP address and port are the same as for the argument to the PORT command.

In extended passive mode, the FTP server operates exactly the same as passive mode, however it only transmits the port number (not broken into high and low bytes) and the client is to assume that it connects to the same IP address that was originally connected to. Extended passive mode was added by the RFC 2428 September 1998.

While data is being transferred via the data stream, the control stream sits idle. This can cause problems with large data transfers through the firewalls which time out sessions after lengthy periods of idleness. While the file may well be successfully transferred, the control session can be disconnected by the firewall, causing an error to be generated.

The FTP protocol supports resuming of interrupted downloads using the REST command. The client passes the number of bytes it has already received as argument to the REST command and restarts the transfer. In some commandline clients for example, there is an often-ignored but valuable command, "reget" (meaning "get again") that will cause an interrupted "get" command to be continued, hopefully to completion, after a communications interruption.

Resuming uploads is not as easy. Although the FTP protocol supports the APPE command to append data to a file on the server, the client does not know the exact position at which a transfer got interrupted. It has to obtain the size of the file some other way, for example over a directory listing or using the SIZE command.

In ASCII mode (see below), resuming transfers can be troublesome if client and server use different end of line characters

The objectives of FTP, as outlined by its RFC are

  1. To promote sharing of files (computer programs and/or data).
  2. To encourage indirect or implicit use of the remote computers.
  3. To shield a user from variations in file storage systems among different hosts.
  4. To transfer data, and efficiently.

File Transfer Protocol

File Transfer Protocol (FTP) is a network protocol to transfer data from one computer to another through a network, such as over the Internet.

FTP is a file transfer protocol for exchanging files over any TCP/IP based network to manipulate files on another computer on that network regardless of which operating systems are involved (if the computers permit FTP access). There are many existing FTP client and server programs. FTP servers can be set up anywhere between game servers, voice servers, internet hosts, and other physical servers.

general description of ethernet



Ethernet was originally based on the idea of computers communicating over a shared coaxial cable acting as a broadcast transmission medium. The methods used show some similarities to radio systems, although there are fundamental differences, such as the fact that it is much easier to detect collisions in a cable broadcast system than a radio broadcast. The common cable providing the communication channel was likened to ether and it was from this reference that the name "Ethernet" was derived.

From this early and comparatively simple concept, Ethernet evolved into the complex networking technology that today underlies most LANs. The coaxial cable was replaced with point-to-point links connected by the Ethernet hubs and/or the switches to reduce installation costs, increase reliability, and enable point-to-point management and troubleshooting. StarLAN was the first step in the evolution of Ethernet from a coaxial cable bus to a hub-managed, twisted-pair network. The advent of twisted-pair wiring dramatically lowered installation costs relative to competing technologies, including the older Ethernet technologies.

Latest technology from Intel

Hafnium-based Intel


Using dramatically new materials including hafnium-based circuitry, new Intel® 45nm Hi-k metal gate silicon technology helps to dramatically increase processor energy efficiency and performance for an unprecedented computing experience.

With this breakthrough transistor technology, Intel is manufacturing serious advantage into every hafnium-based Intel 45nm Hi-k chip.

These revolutionary new processors empower a more enjoyable computing experience for your gaming, multimedia and multitasking, at work, at home, and at play.

Thursday, February 21, 2008

health concerns

Health concerns
Bluetooth uses the microwave radio frequency spectrum in the 2.4 GHz to 2.4835 GHz range. Maximum power output from a Bluetooth radio is 100 mW, 2.5 mW, and 1 mW for Class 1, Class 2, and Class 3 devices respectively, which puts Class 1 at roughly the same level as mobile phones, and the other two classes much lower. Accordingly, Class 2 and Class 3 Bluetooth devices are considered less of a potential hazard than mobile phones, and Class 1 may be comparable to that of mobile phones.

security

Security

Overview
Bluetooth implements confidentiality, authentication and key derivation with custom algorithms based on the SAFER+ block cipher. In Bluetooth, key generation is generally based on a Bluetooth PIN, which must be entered into both devices. This procedure might be modified if one of the devices has a fixed PIN, e.g. for headsets or similar devices with a restricted user interface. During pairing, an initialization key or master key is generated, using the E22 algorithm. The E0 stream cipher is used for encrypting packets, granting confidentiality and is based on a shared cryptographic secret, namely a previously generated link key or master key. Those keys, used for subsequent encryption of data sent via the air interface, rely on the Bluetooth PIN, which has been entered into one or both devices.
An overview of Bluetooth vulnerabilities exploits has been published by Andreas Becker.

Bluejacking
Bluejacking allows phone users to send business cards anonymously using Bluetooth wireless technology. Bluejacking does NOT involve the removal or alteration of any data from the device. These business cards often have a clever or flirtatious message rather than the typical name and phone number. Bluejackers often look for the receiving phone to ping or the user to react. They then send another, more personal message to that device. Once again, in order to carry out a bluejacking, the sending and receiving devices must be within range of each other, which is typically 10 meters for most mobile devices. Devices that are set in non-discoverable mode are not susceptible to bluejacking. However, the Linux application Redfang claims to find non-discoverable Bluetooth devices.

ultra low power bluetooth

On June 12, 2007, Nokia and Bluetooth SIG announced that Wibree will be a part of the Bluetooth specification as an ultra low power Bluetooth technology. Expected use cases include watches displaying Caller ID information, sports sensors monitoring your heart rate during exercise, as well as medical devices. The Medical Devices Working Group is also creating a medical devices profile and associated protocols to enable this market.

high speed bluetooth

High-speed Bluetooth
On 28 March 2006 the Bluetooth Special Interest Group announced its selection of the WiMedia Alliance multi-Band Orthogonal Frequency Division Multiplexing (MB-OFDM) version of UWB for integration with current Bluetooth wireless technology.
UWB integration will create a version of Bluetooth wireless technology with a high-speed/high-data-rate option. This new version of Bluetooth technology will meet the high-speed demands of synchronizing and transferring large amounts of data, as well as enabling high-quality video and audio applications for portable devices, multi-media projectors and television sets, and wireless VOIP.
At the same time, Bluetooth technology will continue catering to the needs of very low power applications such as mice, keyboards, and mono headsets, enabling devices to select the most appropriate physical radio for the application requirements, thereby offering the best of both worlds

future of bluetooth

Broadcast Channel: enables Bluetooth information points. This will drive the adoption of Bluetooth into mobile phones, and enable advertising models based around users pulling information from the information points, and not based around the object push model that is used in a limited way today.
Topology Management: enables the automatic configuration of the piconet topologies especially in scatternet situations that are becoming more common today. This should all be invisible to the users of the technology, while also making the technology just work.
Alternate MAC PHY: enables the use of alternative MAC and PHY's for transporting Bluetooth profile data. The Bluetooth Radio will still be used for device discovery, initial connection and profile configuration, however when lots of data needs to be sent, the high speed alternate MAC PHY's will be used to transport the data. This means that the proven low power connection models of Bluetooth are used when the system is idle, and the low power per bit radios are used when lots of data needs to be sent.
QoS improvements: enable audio and video data to be transmitted at a higher quality, especially when best effort traffic is being transmitted in the same piconet.

Operating system support for bluetooth


Operating system support.


Apple has supported Bluetooth since Mac OS X version 10.2 released in 2002.
As for Microsoft platforms, Windows XP Service Pack 2 and later releases have native support for Bluetooth. Previous versions required the users to install their Bluetooth adapter's own drivers, which were not directly supported by Microsoft. Microsoft's own Bluetooth dongles (that are packaged with their Bluetooth computer devices) have no external drivers and thus require at least Windows XP Service Pack 2.
Linux provides two Bluetooth stacks, with the BlueZ stack included with most Linux kernels. It was originally developed by Qualcomm and Affix. BlueZ supports all core Bluetooth protocols and layers.
NetBSD features Bluetooth support since its 4.0 release. Its Bluetooth stack has been ported to FreeBSD and OpenBSD as well.

Wi-Fi

Wi-Fi
Wi-Fi is more like traditional Ethernet networks, and requires configuration to set up shared resources, transmit files, and to set up audio links (for example, headsets and hands-free devices). It uses the same radio frequencies as Bluetooth, but with higher power resulting in a stronger connection. Wi-Fi is sometimes called "wireless Ethernet." This description is accurate as it also provides an indication of its relative strengths and weaknesses. Wi-Fi requires more setup, but is better suited for operating full-scale networks because it enables a faster connection, better range from the base station, and better security than Bluetooth.

bluetooth vs Wi-Fi in networking

Bluetooth and Wi-Fi have slightly different applications in today's offices, homes, and on the move: setting up networks, printing, or transferring presentations and files from PDAs to computers. Both are versions of unlicensed spread spectrum technology.
Bluetooth differs from Wi-Fi in that the latter provides higher throughput and covers greater distances, but requires more expensive hardware and higher power consumption. They use the same frequency range , but employ different modulation techniques. While Bluetooth is a replacement for a variety of applications, Wi-Fi is a replacement only for local area network access. Bluetooth is often thought of as wireless USB, whereas Wi-Fi is wireless Ethernet, both operating at much lower bandwidth than the cable systems they are trying to replace. However, this analogy is not entirely accurate since any Bluetooth device can, in theory, host any other Bluetooth device—something that is not universal to USB devices, therefore it would resemble more a wireless FireWire.

a typical bluetooth




applications of bluetooth

More prevalent applications of Bluetooth include:

  • Wireless control of and communication between a mobile phone and a hands-free headset. This was one of the earliest applications to become popular.
    Wireless networking between PCs in a confined space and where little bandwidth is required.
  • Wireless communications with PC input and output devices, the most common being the mouse, keyboard and printer.
  • Transfer of files between devices with OBEX.
  • Transfer of contact details, calendar appointments, and reminders between devices with OBEX.
  • Replacement of traditional wired serial communications in test equipment, GPS receivers, medical equipment, bar code scanners, and traffic control devices.
  • For controls where infrared was traditionally used.
  • Sending small advertisements from Bluetooth enabled advertising hoardings to other, discoverable, Bluetooth devices.
  • Two seventh-generation game consoles, Nintendo's Wii[2] and Sony's PlayStation 3, use Bluetooth for their respective wireless controllers.
  • Dial-up internet access on personal computer or PDA using a data-capable mobile phone as a modem.

bluetooth uses

Uses:
Bluetooth is a standard and communications protocol primarily designed for low power consumption, with a short range (power-class-dependent: 1 METER, 10 meters, 100 meters) based on low-cost TRANSCIEVER MICROCHIPin each device.

Bluetooth enables these devices to communicate with each other when they are in range. The devices use a radio communications system, so they do not have to be in line of sight of each other, and can even be in other rooms, as long as the received transmission is powerful enough.
Class
Maximum Permitted Power mW(dBm)
Range(approximate)
Class 1
100 mW (20 dBm)
~100 meters
Class 2
2.5 mW (4 dBm)
~10 meters
Class 3
1 mW (0 dBm)
~1 meter
It has to be noted that in most cases the effective range of class 2 devices is extended if they connect to a class 1 transceiver, compared to pure class 2 network. This is accomplished by higher sensitivity and transmitter power of the Class 1 device. The higher transmitter power of Class 1 device allows higher power to be received by the Class 2 device. Furthermore, higher sensitivity of Class 1 device allows reception of much lower transmitted power of the Class 2 devices. Thus, allowing operation of Class 2 devices at much higher distances.

BLUETOOTH

Bluetooth is an industrial specification for (PANs). Bluetooth provides a way to connect and exchange information between devices such as laptops,mobiles,personal computers,digital computers and video game consoles over a secure, globally unlicensed short-range radio frequency. The Bluetooth specifications are developed and licensed by the bluetooth special intrest group.

Saturday, January 5, 2008

Error Detection

Error Detection

Error correction is relatively expensive (computationally and in bandwidth).

For example, 10 redundancy bits are required to correct 1 single-bit error in a 1000-bit message. Detection? In contrast, detecting a single bit error requires only a single-bit, no matter how large the message.

The most popular error detection codes are based on polynomial codes or cyclic redundancy codes (CRCs).

Allows us to acknowledge correctly received frames and to discard incorrect ones.

Parity Bits

Parity Bits

For example, consider parity: A single parity bit is appended to each data block (e.g. each character in ASCII systems) so that the number of 1 bits always adds up to an even (odd) number.

1000000(1) 1111101(0)

The Hamming Distance for parity is 2, and it cannot correct even single-bit errors (but can detect single-bit errors).

As another example, consider a 10-bit code used to represent 4 possible values: ``00000 00000'', ``00000 11111'', ``11111 00000'', and ``11111 11111''. Its Hamming distance is 5, and we can correct 2 single-bit errors:

For instance, ``10111 00010'' becomes ``11111 00000'' by changing only two bits.

However, if the sender transmits ``11111 00000'' and the receiver sees ``00011 00000'', the receiver will not correct the error properly.

Finally, in this example we are guaranteed to catch all 2-bit errors, but we might do better: if ``00111 00111'' contains 4 single-bit errors, we will reconstruct the block correctly.

Understanding Errors

To understand errors, consider the following:

  1. Messages (frames) consist of m data (message) bits and r redundancy bits, yielding an n = (m+r)-bit codeword.
  2. Hamming Distance. Given any two codewords, we can determine how many of the bits differ. Simply exclusive or (XOR) the two words, and count the number of 1 bits in the result.
  3. Significance? If two codewords are d bits apart, d errors are required to convert one to the other.
  4. A code's Hamming Distance is defined as the minimum Hamming Distance between any two of its legal codewords (from all possible codewords).
  5. In general, all tex2html_wrap_inline191 possible data words are legal. However, by choosing check bits carefully, the resulting codewords will have a large Hamming Distance. The larger the Hamming distance, the better able the code can detect errors.

To detect d 1-bit errors requires having a Hamming Distance of at least d+1 bits. Why?

To correct d errors requires 2d+1 bits. Intuitively, after d errors, the garbled messages is still closer to the original message than any other legal codeword.

Attacks Against Errors

There are two types of attacks against errors:

Error Detecting Codes:
Include enough redundancy bits to detect errors and use ACKs and retransmissions to recover from the errors.
Error Correcting Codes:
Include enough redundancy to detect and correct errors.

Error Detection and Correction

Error Detection and Correction

In data communication, line noise is a fact of life (e.g., signal attenuation, natural phenomenon such as lightning, and the telephone repairman). Moreover, noise usually occurs as bursts rather than independent, single bit errors. For example, a burst of lightning will affect a set of bits for a short time after the lightning strike.

Detecting and correcting errors requires redundancy -- sending additional information along with the data.

Flow Control

Flow Control

Flow control deals with throttling the speed of the sender to match that of the receiver. Usually, this is a dynamic process, as the receiving speed depends on such changing factors as the load, and availability of buffer space.

One solution is to have the receiver extend credits to the sender. For each credit, the sender may send one frame. Thus, the receiver controls the transmission rate by handing out credits.


Sequence Numbers

Sequence Numbers:

Retransmissions introduce the possibility of duplicate frames. To suppress duplicates, add sequence numbers to each frame, so that a receiver can distinguish between new frames and old copies.

Timers

Timers:

One problem that simple ACK/NACK schemes fail to address is recovering from a frame that is lost, and as a result, fails to solicit an ACK or NACK. What happens if an ACK or NACK becomes lost?

Retransmission timers are used to resend frames that don't produce an ACK. When sending a frame, schedule a timer to expire at some time after the ACK should have been returned. If the timer goes off, retransmit the frame.

Acknowledgements

Acknowledgements:

Typically, reliable delivery is achieved using the ``acknowledgments with retransmission'' paradigm, whereby the receiver returns a special acknowledgment (ACK) frame to the sender indicating the correct receipt of a frame.

In some systems, the receiver also returns a negative acknowledgment (NACK) for incorrectly-received frames. This is nothing more than a hint to the sender so that it can retransmit a frame right away without waiting for a timer to expire.

Error Control

Error Control

Error control is concerned with insuring that all frames are eventually delivered (possibly in order) to a destination. How? Three items are required.
  • Acknowledgements
  • Timers
  • Sequence numbers

Encoding Violations

Encoding Violations:

Send an signal that doesn't conform to any legal bit representation. In Manchester encoding, for instance, 1-bits are represented by a high-low sequence, and 0-bits by low-high sequences. The start/end of a frame could be represented by the signal low-low or high-high.

The advantage of encoding violations is that no extra bandwidth is required as in bit-stuffing. The IEEE 802.4 standard uses this approach.


Character stuffing

Character stuffing:

Same idea as bit-stuffing, but operates on bytes instead of bits.

Use reserved characters to indicate the start and end of a frame. For instance, use the two-character sequence DLE STX (Data-Link Escape, Start of TeXt) to signal the beginning of a frame, and the sequence DLE ETX (End of TeXt) to flag the frame's end.

Problem: What happens if the two-character sequence DLE ETX happens to appear in the frame itself?

Solution: Use character stuffing; within the frame, replace every occurrence of DLE with the two-character sequence DLE DLE. The receiver reverses the processes, replacing every occurrence of DLE DLE with a single DLE.

Example: If the frame contained ``A B DLE D E DLE'', the characters transmitted over the channel would be ``DLE STX A B DLE DLE D E DLE DLE DLE ETX''.

Disadvantage: character is the smallest unit that can be operated on; not all architectures are byte oriented.

Bit Stuffing

Bit Stuffing:

Use reserved bit patterns to indicate the start and end of a frame. For instance, use the 4-bit sequence of 0111 to delimit consecutive frames. A frame consists of everything between two delimiters.

Problem: What happens if the reserved delimiter happens to appear in the frame itself? If we don't remove it from the data, the receiver will think that the incoming frame is actually two smaller frames!

Solution: Use bit stuffing. Within the frame, replace every occurrence of two consecutive 1's with 110. E.g., append a zero bit after each pair of 1's in the data. This prevents 3 consecutive 1's from ever appearing in the frame.

Likewise, the receiver converts two consecutive 1's followed by a 0 into two 1's, but recognizes the 0111 sequence as the end of the frame.

Example: The frame ``1011101'' would be transmitted over the physical layer as ``0111101101010111''.

Note: When using bit stuffing, locating the start/end of a frame is easy, even when frames are damaged. The receiver simply scans arriving data for the reserved patterns. Moreover, the receiver will resynchronize quickly with the sender as to where frames begin and end, even when bits in the frame get garbled.

The main disadvantage with bit stuffing is the insertion of additional bits into the data stream, wasting bandwidth. How much expansion? The precise amount depends on the frequency in which the reserved patterns appear as user data.

Length Count

Length Count:

Make the first field in the frame's header be the length of the frame. That way the receiver knows how big the current frame is and can determine where the next frame ends.

Disadvantage: Receiver loses synchronization when bits become garbled. If the bits in the count become corrupted during transmission, the receiver will think that the frame contains fewer (or more) bits than it actually does. Although checksum will detect the incorrect frames, the receiver will have difficulty resynchronizing to the start of a new frame. This technique is not used anymore, since better techniques are available.

Framing

The DLL translates the physical layer's raw bit stream into discrete units (messages) called frames. How can the receiver detect frame boundaries? That is, how can the receiver recognize the start and end of a frame?
  • Length Count
  • Bit Stuffing
  • Character stuffing
  • Encoding Violations

DLL Design Issues

Design Issues

If we don't follow the OSI reference model as gospel, we can imagine providing several alternative service semantics:

Reliable Delivery:
Frames are delivered to the receiver reliably and in the same order as generated by the sender.

Connection state keeps track of sending order and which frames require retransmission. For example, receiver state includes which frames have been received, which ones have not, etc.

Best Effort:
The receiver does not return acknowledgments to the sender, so the sender has no way of knowing if a frame has been successfully delivered.

When would such a service be appropriate?

  1. When higher layers can recover from errors with little loss in performance. That is, when errors are so infrequent that there is little to be gained by the data link layer performing the recovery. It is just as easy to have higher layers deal with occasional lost packet.
  2. For real-time applications requiring ``better never than late'' semantics. Old data may be worse than no data. For example, should an airplane bother calculating the proper wing flap angle using old altitude and wind speed data when newer data is already available.
Acknowledged Delivery:
The receiver returns an acknowledgment frame to the sender indicating that a data frame was properly received. This sits somewhere between the other two in that the sender keeps connection state, but may not necessarily retransmit unacknowledged frames. Likewise, the receiver may hand received packets to higher layers in the order in which the arrive, regardless of the original sending order.

Typically, each frame is assigned a unique sequence number, which the receiver returns in an acknowledgment frame to indicate which frame the ACK refers to. The sender must retransmit unacknowledged (e.g., lost or damaged) frames.

Thursday, January 3, 2008

Disadantage of OSI model

Software that is used alongside this strict layering scheme can be very inefficient. Implementors for this reason tend to relax strict layering when building protocol software. They allow data such as network MTU and route selection to flow upward through the layers. In providing buffers they leave space for headers that will be added by lower layer protocols.

Application layer

Layer 7: Application layer


This layer interfaces directly to and performs application services for the application processes; it also issues requests to the presentation layer. Note carefully that this layer provides services to user-defined application processes, and not to the end user. For example, it defines a file transfer protocol, but the end user must go through an application process to invoke file transfer. The OSI model does not include human interfaces. The common application services sublayer provides functional elements including the Remote Operations Service Element (comparable to Internet Remote Procedure Call), Association Control, and Transaction Processing (according to the ACID requirements).

Above the common application service sublayer are functions meaningful to user application programs, such as messaging (X.400), directory (X.500), file transfer (FTAM), virtual terminal (VTAM), and batch job manipulation (JTAM). These contrast with user applications that use the services of the application layer, but are not part of the application layer itself.

  1. File Transfer applications using FTAM (OSI protocol) or FTP (TCP/IP Protocol)
  2. Mail Transfer clients using X.400 (OSI protocol) or SMTP/POP3/IMAP (TCP/IP protocols)
  3. Web browsers using the HTTP (TCP/IP protocol); no true OSI protocol for web applications

Presentation layer

Layer 6: Presentation layer


This layer establishes a context between application layer entities, in which the higher-layer entities can use different syntax and semantics, as long as the Presentation Service understands both and the mapping between them. The presentation service data units are then encapsulated into Session Protocol Data Units, and moved down the stack.

The original presentation structure used the Basic Encoding Rules of the Abstract Syntax Notation One (ASN.1), with capabilities such as converting an EBCDIC-coded text file to an ASCII-coded text file and other data structures into and out of XML. ASN.1 has a set of cryptographic encoding rules that allows end-to-end encryption between application entities.

Session layer

LAYER 5 - Session layer


This layer controls the dialogues/connections (sessions) between computers. It establishes, manages and terminates the connections between the local and remote application. It provides for full-duplex, half -duplex or simplex operation, and establishes check pointing, adjournment, termination, and restart procedures. The OSI model made this layer responsible for "graceful close" of sessions, which is a property of TCP, and also for session check pointing and recovery, which is not usually used in the Internet protocols suite. Session layers are commonly used in application environments that make use of remote procedure calls (RPCs).


The iSCSI, which implements the Small Computer Systems Interface encapsulated into TCP/IP packets, is a session layer protocol increasingly used in the Storage Area Networks and internally between processors and high-performance storage devices. iSCSI uses TCP for guaranteed delivery, and carries SCSI command descriptor blocks (CDB) as payload to create a virtual SCSI bus between iSCSI initiators and iSCSI targets.

Transport layer

Layer 4: Transport layer


This layer provides transparent transfer of data between end users, providing reliable data transfer services to the upper layers. The transport layer controls the reliability of a given link through flow control, segmentation/desegmentation, and error control. Some protocols are state and connection oriented. This means that the transport layer can keep track of the segments and retransmit those that fail.

Although it was not developed under the OSI Reference Model and does not strictly conform to the OSI definition of the Transport Service, the best known example of a layer 4 protocol is the TCP( Transmission Control Protocol). The transport layer is the layer that converts messages into TCP segments or UDP ( User Datagram Protocol) , SCTP (Stream Control Transmission Protocol), etc. packets.

Of the actual OSI protocols, not merely protocols developed under the model, there are five classes of transport protocols, ranging from class 0 (which is also known as TP0 and provides the least error recovery) to class 4 (which is also known as TP4 and is designed for less reliable networks, similar to the Internet). Class 4 is closest to TCP, although TCP contains functions, such as the graceful close, which OSI assigns to the Session Layer.

Perhaps an easy way to visualize the Transport Layer is to compare it with a Post Office, which deals with the dispatch and classification of mail and parcels sent. Do remember, however, that a post office manages the outer envelope of mail. Higher layers may have the equivalent of double envelopes, such as cryptographic presentation services that can be read by the addressee only. Roughly speaking, tunneling protocols operate at the transport layer, such as carrying non-IP protocols over an IP network, or end-to-end encryption . While GRE (Generic Routing Encapsulation) might seem to be a network layer protocol, if the encapsulation of the payload takes place only at endpoint, GRE becomes closer to a transport protocol that uses IP headers but contains complete frames or packets to deliver to an endpoint.

Network layer

Layer 3: Network layer

This layer provides the functional and procedural means of transferring variable length data sequences from a source to a destination via one or more networks while maintaining the quality of service requested by the Transport layer. The Network layer performs network routing functions, and might also perform fragmentation and reassembly, and report delivery errors. ROUTERS operate at this layer—sending data throughout the extended network and making the Internet possible. This is a logical addressing scheme – values are chosen by the network engineer. The addressing scheme is hierarchical.(already a post on ROUTERS is posted earlier).

The best-known example of a layer 3 protocol is the Internet Protocol (IP). It manages the Connectionless transfer of data one hop at a time, from end system to ingress router, to router to router, and from egress router to destination end system. It is not responsible for reliable delivery to a next hop, but only for the detection of errored packets so they may be discarded. When the medium of the next hop cannot accept a packet in its current length, IP is responsible for fragmenting into sufficiently small packets that the medium can accept it.

A number of layer management protocols, a function defined in the Management Annex, ISO 7498/4, belong to the network layer. These include routing protocols, multicast group management, network layer information and error, and network layer address assignment. It is the function of the payload that makes these belong to the network layer, not the protocol that carries them.

Data Link layer

Layer 2: Data Link layer


This layer provides the functional and procedural means to transfer data between network entities and to detect and possibly correct errors that may occur in the Physical layer. Originally, this layer was intended for point-to-point and point-to-multi point media, characteristic of wide area media in the telephone system. Local area network architecture, which included broadcast-capable multi access media, was developed independently of the ISO work,in the IEEE project802. IEEE work assumed sub layering and management functions not required for WAN use. In modern practice, only error detection, not flow control using sliding window, is present in modern data link protocols such as the point-to-point protocol (PPP), and, on local area networks, the IEEE 802.2 LLC layer is not used for most protocols on Ethernet, and, on other local area networks, its flow control and acknowledgment mechanisms are rarely used. Sliding window flow control and acknowledgment is used at the transport layers by protocols such as the TCP, but is still used in niches where the X.25 offers performance advantages.

Both WAN and LAN services arrange bits, from the physical layer, into logical sequences called frames. Not all physical layer bits necessarily go into frames, as some of these bits are purely intended for physical layer functions. For example, every fifth bit of the Fiber distributed data interface (FDDI) bit stream is not used by the data link layer.

Physical layer

Layer 1: Physical layer


The Physical layer defines all the electrical and physical specifications for devices. In particular, it defines the relationship between a device and a physical medium. This includes the layout of the pins,voltages,hubs,cable specifications, repeaters, network adapters, Host Bus Adapters(HBA) and more.

To understand the function of the physical layer in contrast to the functions of the data link layer, think of the physical layer as concerned primarily with the interaction of a single device with a medium, where the data link layer is concerned more with the interactions of multiple devices (i.e., at least two) with a shared medium. The physical layer will tell one device how to transmit to the medium, and another device how to receive from it (in most cases it does not tell the device how to connect to the medium). Obsolescent physical layer standards such as the RS-232 do use physical wires to control access to the medium.

The major functions and services performed by the physical layer are:

  • Establishment and termination of a connection to a communication medium.
  • Participation in the process whereby the communication resources are effectively shared among multiple users. For example, flow control and contention resolution.
  • The Modulation, or conversion between the representation of the digital data in user equipment and the corresponding signals transmitted over a communications channel. These are signals operating over the physical cabling (such as copper and the optical fiber) or over a radio link.

history of OSI

In 1977, work on a layered model of network architecture, which was to become the OSI model, started in the ANSI (American National Standards Institute) working group on Distributed Systems (DISY). With the DISY work and worldwide input, the ISO (International Organization for standardization) began to develop its OSI networking suite.According to Bachman, the term "OSI" came into use on 12 October 1979. OSI has two major components: an abstract model of networking (the Basic Reference Model, or seven-layer model) and a set of concrete protocols. The standard documents that describe OSI can be downloaded from ISO .

Parts of OSI have influenced Internet protocol development, but none more than the abstract model itself, documented in ISO 7498 and its various addenda. In this model, a networking system is divided into layers. Within each layer, one or more entities implement its functionality. Each entity interacts directly only with the layer immediately beneath it, and provides facilities for use by the layer above it.

In particular, Internet protocols are deliberately not as rigorously architected as the OSI model, but a common version of TCP/IP model splits it into four layers. The Internet Application Layer includes the OSI Application Layer, Presentation Layer, and most of the Session Layer. Its End-to-End Layer includes the graceful close function of the OSI Session Layer as well as the Transport Layer. Its Internetwork Layer is equivalent to the OSI Network Layer, while its Interface layer includes the OSI Data Link and Physical Layers. These comparisons are based on the original seven-layer protocol model as defined in ISO 7498, rather than refinements in such things as the Internal Organization of the Network Layer document.

Protocols enable an entity in one host to interact with a corresponding entity at the same layer in a remote host. Service definitions abstractly describe the functionality provided to an (N)-layer by an (N-1) layer, where N is one of the seven layers inside the local host.

How does a OSI reference model look like ?


The architecture of an OSI reference model looks like this.

OSI reference model

The Open Systems Interconnection Basic Reference Model (OSI Reference Model or OSI Model for short) is a layered, abstract description for communications and the computer network protocol design. It was developed as part of Open Systems Interaction ( OSI ) initiative and is sometimes known as the OSI seven layer model. From top to bottom, the OSI Model consists of the Application, Presentation, Session, Transport, Network, Data Link, and Physical layers. A layer is a collection of related functions that provides services to the layer above it and receives service from the layer below it. For example, a layer that provides error-free communications across a network provides the path needed by applications above it, while it calls the next lower layer to send and receive packets that make up the contents of the path.

the OSI model is an excellent place to begin the study of network architecture. Not understanding that the pure seven-layer model is more historic than current, many beginners make the mistake of trying to fit every protocol they study into one of the seven basic layers. This is not always easy to do as many of the protocols in use
today on Internet were designed as part of a model TCP/IP model, and may not fit cleanly into the OSI model.

Wednesday, January 2, 2008

ROUTER

what is a router ?

Router is a device that forwards the data packets along with the networks. A router is connected to at least 2 networks , commonly 2 LANs or WANs or a LAN and its network ISP's. Routers are located at the gateways, the places where two or more networks connect.

Routers uses the headers and forwarding tables to determine the best path for forwarding the packets, and they use the protocols such as the ICMP to communicate with each other and configure the best route between any two hosts.

Very little filtering of data is done through routers.

Tuesday, January 1, 2008

How to build a simple computer network

Building a simple computer network

A simple computer network may be constructed from two computers where network adapter (Network Interface Controller ( NIC )) is added to each computer and then connecting them together with a special cable crossover cable. This type of network is useful for transferring information between two computers that are not normally connected to each other by a permanent network connection or for basic home networking applications. Alternatively, a network between two computers can be established without dedicated extra hardware by using a standard connection on both computers, connecting them to each other via a special null modem cable which is cross linked.

Practical networks generally consist of more than two interconnected computers and generally require special devices in addition to the Network Interface Controller that each computer needs to be equipped with. Examples of some of these special devices are hubs, switches and routers.

Internet

INTERNET:

The Internet is a vast collection of different networks that use certain common protocols and provide certain common services. It is an unusual system in that it was not planned by anyone and is not controlled by anyone.

Extranet


An extranet is a network or internetwork that is limited in scope to a single organization or entity but which also has limited connections to the networks of one or more other usually, but not necessarily, trusted organizations or entities (e.g. a company's customers may be given access to some part of its intranet creating in this way an extranet, while at the same time the customers may not be considered 'trusted' from a security standpoint). Technically, an extranet may also be categorized as a CAN, MAN, WAN, or other type of network, although, by definition, an extranet cannot consist of a single LAN; it must have at least one connection with an external network.

INTRANET


Intranet


An intranet is a set of interconnected networks, Internet Protocol is used and uses IP-based tools such as web browsers, that is under the control of a single administrative entity. That administrative entity closes the intranet to the rest of the world, and allows only specific users. Most commonly, an intranet is the internal network of a company or other enterprise.

Internetwork


Internetwork

Two or more networks or network segments connected using devices that operate at layer 3 (the 'network' layer) of the OSI Basic Reference Model, such as a router. Any interconnection among or between public, private, commercial, industrial, or governmental networks may also be defined as an internetwork.

In modern practice, the interconnected networks use the Internet Protocol. There are at least three variants of internetwork, depending on who administers and who participates in them:

  • Intranet
  • Extranet
  • "The" Internet

Intranets and extranets may or may not have connections to the Internet. If connected to the Internet, the intranet or extranet is normally protected from being accessed from the Internet without proper authorization. The Internet itself is not considered to be a part of the intranet or extranet, although the Internet may serve as a portal for access to portions of an extranet.


Global Area Network (GAN)


Global area networks (GAN) specifications are in development by several groups, and there is no common definition. In general, however, a GAN is a model for supporting mobile communications across an arbitrary number of wireless LAN's , satellite coverage areas, etc. The key challenge in mobile communications is "handing off" the user communications from one local coverage area to the next.

IEEE mobility efforts focus on the data link layer and make assumptions about the media.

Wide Area Network (WAN)


Wide Area Network (WAN)

A WAN is a data communications network that covers a relatively broad geographic area (i.e. one city to another and one country to another country) and that often uses transmission facilities provided by common carriers, such as telephone companies.

We will follow traditional usage and call these machines hosts.The hosts are connected by a communication subnet, or just subnet for short .the hosts are owned by the customers whereas the communication subnet is typically owned and operated by a telephone company or Internet service provider. The job of the subnet is to carry messages from host to host, just as telephone system which carries words from speaker to listener.

in most WAN's , the subnet consists of 2 distinct components:

-transmission lines :moves bits between machines.

-Switching elements : are specialized computers that connect three or more transmission lines.

the switching computers are commonly known as routers.

the figure shows how a WAN is useful for companies.


Metropolitan Area Network (MAN)


Metropolitan Area Network (MAN)



A Metropolitan Area Network is a network that connects two or more Local Area Networks or Campus Area Networks together but does not extend beyond the boundaries of the immediate town, city, or metropolitan area. Multiple routers, switches & hubs are connected to create a MAN.


Campus Area Network (CAN)

Campus Area Network (CAN)



A network that connects two or more LAN's but that is limited to a specific and contiguous geographical area such as a college campus, industrial complex, or a military base. A CAN, may be considered a type of MAN (metropolitan area network), but is generally limited to an area that is smaller than a typical MAN.

This term is most often used to discuss the implementation of networks for a contiguous area.Today, a campus may use a mixture of routing and bridging.The network elements used, called "campus switches", tend to be optimized to have many Ethernet-family interfaces rather than an arbitrary mixture of Ethernet and WAN interfaces.

LAN


LAN-


A network covering a small geographic area, like a home, office, or building. Current LANs are most likely to be based on Ethernet technology. For example, a library will have a wired or wireless LAN for users to interconnect local devices (e.g., printers and servers) connect to the internet.

as shown in the figure........the LAN is used to connect the different computers in small area.


The staff computers (bright green) can get to the color printer, checkout records, and the academic network and the Internet. All user computers can get to the Internet and the card catalog. Each work group can get to its local printer. Note that the printers are not accessible from outside their work group.

All interconnect devices must understand the network layer (layer 3), because they are handling multiple subnets (the different colors). Those inside the library, which have only 10/100 Mbps Ethernet connections to the user device and a Gigabit Ethernet connection to the central router, could be called "layer 3 switches" because they only have Ethernet interfaces and IP must be understood . It would be more correct to call them access routers, where the router at the top is a distribution router that connects to the Internet and academic networks' customer access routers.

PAN

Personal Area Network (PAN)

A personal area network (PAN) is a computer network used for communication among computer devices close to one person. Some examples of devices that may be used in a PAN are printers, fax machines, telephones, or scanners. The reach of a PAN is typically within about 20-30 feet (approximately 4-6 Meters). And this can be used for communication among the individual devices (intrapersonal communication), or for connecting to a higher level network and the Internet (an uplink).


What is computer networks?


What is computer networks?

A computer network is an interconnection of a group of computers. Networks may be classified by what is called the network layer at which they operate according to basic reference models considered as standards in the industry such as the four-layer model is internet protocol suite. While the seven-layer reference model is better known as Open Systems Iterconnetion (OSI) constitutes the majority of networks use the Internet Protocol Suite (IP) as their network model.