Archive

Author Archive

Group_13:Avani-Code for Checksum

November 18, 2009 Leave a comment

Program to compute 16-bit internet checksum

//—– Include files ———————————————————
#include // Needed for printf()
#include

//—– Type defines ———————————————————-
typedef unsigned char byte; // Byte is a char
typedef unsigned short int word16; // 16-bit word is a short int
typedef unsigned int word32; // 32-bit word is an int

//—– Defines —————————————————————

#define BUFFER_LEN 4// Length of Buffer

//—– Prototypes ————————————————————
word16 checksum(byte *addr, word32 count);
word16 checksm(byte *addr, word32 count, word32 res);
//===== Main program ==========================================================
int main(void)
{

byte buff[BUFFER_LEN]; // Buffer of packet bytes
word16 check,check1; // 16-bit checksum value
word32 i; // Loop counter

clrscr();

printf(“\nAt the sender’s end\n”);
printf(“———————–\n”);
printf(“Enter the characters\n”);

for (i=0; i<BUFFER_LEN; i++)
{
scanf("%c",&buff[i]);
}

// Compute the 16-bit checksum
check = checksum(buff, BUFFER_LEN);

// Output the checksum
printf("\nchecksum = %04X \n", check);

printf("\n\n\nAt the receiver's end\n");
printf("———————–\n");
printf("Enter the characters\n");

for (i=0; i 1)
{
sum = sum + (*((word16 *) addr)+2);
count = count – 2;

}

// Add left-over byte, if any
if (count > 0)
sum = sum + *((byte *) addr);

// Fold 32-bit sum to 16 bits
while (sum>>16)
sum = (sum & 0xFFFF) + (sum >> 16);

return(~sum);
}

word16 checksm(byte *addr, word32 count,word32 res)
{
register word32 sum = res;

// Main summing loop
while(count > 1)
{
sum = sum + (*((word16 *) addr)+2);
count = count – 2;

}

// Add left-over byte, if any
if (count > 0)
sum = sum + *((byte *) addr);

// Fold 32-bit sum to 16 bits
while (sum>>16)
sum = (sum & 0xFFFF) + (sum >> 16);

return(~sum);
}

Categories: Group13_AVANI

Group_13: Avani- Checksum

November 12, 2009 Leave a comment

CHECKSUM:
Also called hash sum is a fixed-size datum computed from an arbitrary block of digital data for the purpose of detecting accidental errors that may have been introduced during its transmissioner storage. The integrity of the data can be checked at any later time by recomputing the checksum and comparing it with the stored one. If the checksums do not match, the data was certainly altered (either intentionally or unintentionally).
The procedure that yields the checksum from the data is called a checksum function or checksum algorithm. A good checksum algorithm will yield a different result with high probability when the data is accidentally corrupted; if the checksums match, the data is very likely to be free of accidental errors.
Checksum functions are related to hash functions, fingerprints, randomization functions, and cryptographic hash functions. However, each of those concepts has different applications and therefore different design goals. Check digits and parity bits are special cases of checksums, appropriate for small blocks of data (such as Social Security numbers, bank account numbers, computer words, single bytes, etc.). Some error-correcting codes are based on special checksums that not only detect common errors but also allow the original data to be recovered in certain cases.

Applications:
The goal of checksum algorithms is to detect accidental modification such as corruption to stored data or errors in a communication channel. They are not designed to detect intentional corruption by a malicious agent. Indeed, many checksum algorithms can be easily inverted, in the sense that one can easily modify the data so as to preserve its checksum. To guard against malicious changes one should use a cryptographic hash function.

Checksum algorithms:
Parity byte or parity word:
The simplest checksum algorithm is the so-called longitudinal parity check, which breaks the data into “words” with a fixed number n of bits, and then computes the exclusive or of all those words. The result is appended to the message as an extra word. To check the integrity of a message, the receiver computes the exclusive or of all its words, including the checksum; if the result is not a word with n zeros, the receiver knows that a transmission error occurred.
With this checksum, any transmission error that flips a single bit of the message, or an odd number of bits, will be detected as an incorrect checksum. However, an error that affects two bits will not be detected if those bits lie at the same position in two distinct words. If the affected bits are independently chosen at random, the probability of a two-bit error being undetected is 1/n.

Modular sum:
A variant of the previous algorithm is to add all the “words” as unsigned binary numbers, discarding any overflow bits, and append the two’s complement of the total as the checksum. To validate a message, the receiver adds all the words in the same manner, including the checksum; if the result is not a word full of zeros, an error must have occurred. This variant too detects any single-bit error, but the probability that a two-bit error will go undetected is a little less than 1/n.

Position-dependent checksums:
The simple checksums described above fail to detect some common errors that affect many bits at once, such as changing the order of data words, or inserting or deleting words with all bits set to zero. The checksum algorithms that are most used in practice, such as Fletcher’s checksum, Adler-32, and cyclic redundancy checks (CRCs), address these weaknesses by considering not only the value of each word but also its position in the sequence. This feature generally increases the cost of computing the checksum.

Checksum tools:
1). cksum, a Unix command that generates both a 32-bit CRC and a byte count for any given input file.
2). md5sum, a Unix command that generates a MD5 sum (commonly used to verify .iso files)

Categories: Group13_AVANI

Group_13: Avani- Types of error detecting codes

November 6, 2009 Leave a comment

Types of Error detecting codes are as follows:

Repetition schemes:
Given a stream of data that is to be sent, the data is broken up into blocks of bits, and in sending, each block is sent some predetermined number of times. For example, if we want to send “1011″, we may repeat this block three times each.
Suppose we send “1011 1011 1011″, and this is received as “1010 1011 1011″. As one group is not the same as the other two, we can determine that an error has occurred. This scheme is not very efficient, and can be susceptible to problems if the error occurs in exactly the same place for each group (e.g. “1010 1010 1010″ in the example above will be detected as correct in this scheme).

Parity schemes:
A parity bit is an error detection mechanism that can only detect an odd number of errors.
The stream of data is broken up into blocks of bits, and the number of 1 bits is counted. Then, a “parity bit” is set (or cleared) if the number of one bits is odd (or even). (This scheme is called even parity; odd parity can also be used.) If the tested blocks overlap, then the parity bits can be used to isolate the error, and even correct it if the error affects a single bit: this is the principle behind the Hamming code.
There is a limitation to parity schemes. A parity bit is only guaranteed to detect an odd number of bit errors. If an even number of bits are flipped, the parity bit appears to be correct, even though the data is corrupt.

Checksum:
A checksum of a message is an arithmetic sum of message code words of a certain word length, for example byte values, and their carry value. The sum is negated by means of ones-complement, and stored or transferred as an extra code word extending the message.
On the receiver side, a new checksum may be calculated from the extended message. If the new checksum is not 0, an error has been detected.

Cyclic redundancy checks:
More complex error detection (and correction) methods make use of the properties of finite fields and polynomials over such fields.
The cyclic redundancy check considers a block of data as the coefficients to a polynomial and then divides by a fixed, predetermined polynomial. The coefficients of the result of the division is taken as the redundant data bits, the CRC.
On reception, one can recompute the CRC from the payload bits and compare this with the CRC that was received. A mismatch indicates that an error occurred.

Hamming distance based checks:
If we want to detect d bit errors in an n bit word we can map every n bit word into a bigger n+d+1 bit word so that the minimum Hamming distance between each valid mapping is d+1. This way, if one receives a n+d+1 word that doesn’t match any word in the mapping (with a Hamming distance x <= d+1 from any word in the mapping) it can successfully detect it as an erroneous word. Even more, d or fewer errors will never transform a valid word into another, because the Hamming distance between each valid word is at least d+1, and such errors only lead to invalid words that are detected correctly. Given a stream of m*n bits, we can detect x <= d bit errors successfully using the above method on every n bit word. In fact, we can detect a maximum of m*d errors if every n word is transmitted with maximum d errors.

Hash function:
Any hash function can be used as a integrity check. A hash function is any well-defined procedure or mathematical function which converts a large, possibly variable-sized amount of data into a small datum, usually a single integer that may serve as an index to an array. The values returned by a hash function are called hash values, hash codes, hash sums, or simply hashes.

Horizontal and vertical redundancy check:
Horizontal redundancy check is a form of redundancy check that is applied independently to each of a parallel group of bit streams. The data must be divided into transmission blocks, to which the additional check data is added.
Vertical redundancy check is a redundancy check for synchronized parallel bit streams that is applied once per bit time, across the bit streams. This requires additional parallel channels for the check bit or bits.

Categories: Group13_AVANI

Group13_Avani: Brief introduction to error detection and correction

October 28, 2009 Leave a comment

Data processing and transmission systems use a variety of techniques to detect and correct errors that occur, usually for any of the following reasons:
-Electrostatic interference from nearby machines or circuits
-Attenuation of the signal caused by a resistance to current in a cable
-Distortion due to inductance and capacitance
-Loss in transmission due to leakages
-Impulses from static in the atmosphere

Error Types:
1) Single-Bit errors
Errors that corrupt data bits of a transmission, turning a 1 into a 0, and vice versa.
These errors are caused by power surges and other interference.

2) Burst errors
Errors tend to come together in bunches i.e. 2 or more bits in the data unit have changed from 1 to 0 or from 0 to 1.
The number of bits affected depends on the data rate and duration of noise.

Error Detection:
Error detection is the ability to detect the presence of errors caused by noise or other impairments during transmission from the sender to the receiver.

Error detection schemes:
Repetition scheme
Parity scheme
Checksum
Cyclic redundancy checks
Hamming distance based checks
Hash function
Horizontal and Vertical redundancy checks

Error Correction:
Error correction refers to a set of protocols used to recover lost data; due to any of the above mentioned reasons.It is the additional ability to reconstruct the original, error-free data.

There are two basic ways to design the channel code and protocol for an error correcting system:
1) Automatic Repeat Request (ARQ)
The transmitter sends the data and also an error detection code, which the receiver uses to check for errors, and requests retransmission of erroneous data.
In many cases, the request is implicit; the receiver sends an acknowledgement (ACK) of correctly received data, and the transmitter re-sends anything not acknowledged within a reasonable period of time.

2) Forward error correction (FEC)
The transmitter encodes the data with an error-correcting code (ECC) and sends the coded message.
The receiver decodes what it receives into the most likely data. The codes are designed so that it would take an unreasonable amount of noise to trick the receiver into misinterpreting the data.
The receiver never sends any acknowledgement back to the transmitter.

Categories: Group13_AVANI

Group_13: Avani- Problems Faced

October 22, 2009 Leave a comment

The problems which we faced during the course of our Group A project are:

1. We actually had plans of doing the demo on Etherape. But since it was already done by the other group we had to search for the other tool.

2. Then we found out the tool called Ethereal. It worked, but since it was a single interface we dint implement that tool for our demonstration.

3. Next we found out the Multiple interface watcher which worked for multiple interface but it asked for a device file. We initially dint know how to create it but later we explored the tool and showed the demo using this tool.

4. We were very interested in demonstrating Apple talk protocol but since it was a tedious job we dint implement it. It actually needed the Apple computer. None of us in our group had it and hence we couldn’t show the demo.

Categories: Group13_AVANI

Group13_Avani:Description of tools

October 21, 2009 Leave a comment

Tools used:

Ethereal:
Ethereal is a network analyzer. It reads packets from the network,decodes them, and presents them in an easy to understand format.Ethereal is one of the best open source network analyzer available. And the best part is: it’s free! It is packed with features that are comparable to a commercial network analyser. Ethereal’s graphical user interface is configurable and easy to use.Ethereal displays capture information in three main window panes.
1. The upper-most pane is the summary pane that displays a one–line summary of the capture. Ethereal’s default fields include: packet number, time, source address, destination address, name and information about the protocol.

2. The middle pane is the protocol detail view.This pane provides all of the details for each of the layers contained inside the captured packet in a tree-like structure. Clicking on various parts of the protocol tree will highlight corresponding hexadecimal and ASCII output in the bottom pane.

3. The bottom pane displays the raw captured data both in hexadecimal and ASCII format. Clicking on various parts of this data will also highlight the corresponding fields in the protocol tree in the middle pane.

Multiple interface watcher:
MIW is a graph utility that shows the utilisation of up to 20 different network interfaces. The data is requested from the devices using SNMP(Simple Network Management Protocol) . MIW is an advanced development of Interface Traffic Indicator that focuses more on the utilization overview of many interfaces than on much information of one interface.
1. Generate a file with a list of devices that you want to monitor.

2. Start MIW and open the device file.

3. We will see that a number of graphs have changed their colour, they are now activated with the information. Click on ‘Start polling’ to start the monitoring.

4. There are two places to change options: either by clicking on ‘Show more’ which expands the GUI to show polling intervall and other options or select Tools\Options from the menu to change graph behaviour.

Categories: Group13_AVANI

Group13_Avani: Details of Addressing

October 7, 2009 Leave a comment

ADDRESSING:
Communication between two networks takes place through ADDRESSING. Its an identifier which includes information about how to find its subject.

There are four types:
Physical address: MAC address
Logical address: IP address
Specific address
Port address

MAC ADDRESS:
In computer networking, a Media Access Control address (MAC address) is a unique identifier assigned to network interface cards (NICs) by the manufacturer for identification.

FINDING MAC ADDRESS FOR WINDOWS:
1.Click on the Start Menu.
2.Click on ‘Run…’
3.Type ‘cmd’ without quotes and press Enter.
4.At the command prompt, type ‘ipconfig /all’ without quotes. (space between g and /)
5.Alternatively, if using Windows XP, you can use the command ‘getmac’.
6.Your MAC Address is listed under ‘Physical Address’ as a series of 6 groups of two digits, letters and numbers, separated by dashes, such as in the image below. Make sure you get the physical address of the correct network adapter – usually there are several listed.

FINDING MAC ADDRESS FOR LINUX:
1.If you’re running Linux, use the ifconfig command. You may need to reference it from your /bin or /sbin directories.

IP ADDRESS:
An Internet Protocol (IP) address is a numerical label that is assigned to devices participating in a computer network utilizing the Internet Protocol for communication between its nodes. An IP address serves two principal functions in networking: host identification and location addressing.
The original designers of TCP/IP defined an IP address as a 32-bit number and this system, now named Internet Protocol Version 4 (IPv4), is still in use today. However, due to the enormous growth of the Internet and the resulting depletion of the address space, a new addressing system (IPv6), using 128 bits for the address.
The number of these bits is indicated in CIDR notation, appended to the IP address, e.g., 208.77.188.166/24.

Ipv4:
IPv4 uses 32-bit (4-byte) addresses, which limits the address space to 4,294,967,296 (232) possible unique addresses.
IPv4 addresses are usually represented in dot-decimal notation (four numbers, each ranging from 0 to 255, separated by dots, e.g. 208.77.188.166). Each part represents 8 bits of the address, and is therefore called an octet. In less common cases of technical writing, IPv4 addresses may be presented in hexadecimal, octal, or binary representations.

Ipv6:
The rapid exhaustion of IPv4 address space, despite conservation techniques, prompted the Internet Engineering Task Force (IETF) to explore new technologies to expand the Internet’s addressing capability. The address size was increased from 32 to 128 bits or 16 octets, the new address space provides the potential for a maximum of 2128, or about 3.403 × 1038 unique addresses.
The new design is not based on the goal to provide a sufficient quantity of addresses alone, but rather to allow efficient aggregation of subnet routing prefixes to occur at routing nodes. The new design also provides the opportunity to separate the addressing infrastructure of a network segment—that is the local administration of the segment’s available space—from the addressing prefix used to route external traffic for a network.
Example of an IPv6 address:
2001:0db8:85a3:08d3:1319:8a2e:0370:7334

IP ADDRESS OF WINDOWS BASED OPERATING SYSTEM:
1.Click on Start in the bottom left hand corner of your screen.
2.Click on Run. An input box will appear with a flashing cursor.
3.Type “cmd” or “Command” in the Run box.
4.Click on OK or press the Enter key on your keyboard. Or click on start. Go to programs. Go to Accessories and click on Command Prompt.
5.An MS DOS Window will open. You are now ready to send a command to your computer.
6.Type “netstat -n” including the space.
7.Press Enter.
8.You will see a list of all your active connections and IP numbers.
9.You will see four fields with four columns.
10.The Local Address field identifies your IP number. The Foreign Address field shows the IP numbers of the sites or people to whom you are connected. In the image, I am talking to two friends on Messenger, so two IP addresses are shown in the Foreign Address field.
11.You can also see what programs are being used to connect to those IP addresses by typing “netstat -nab”. That way, if you are connected to more than one foreign IP address, you can more easily pick out the address you are interested in.
12.Also another way you can do it is Start>Run>Cmd>Ipconfig This should show you: your masked IP and IP.
13.An easy alternative way to determine your IP is to use an online IP checker like Get My IP Address.

IP ADDRESS OF LINUX BASED OPERATING SYSTEM:
To find out IP address of Linux/UNIX/BSD/Unixish system use the command called ifconfig. It is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed. If no arguments are given to ifconfig command it displays the status of the current active interfaces. It displays Ethernet IP address, Mac address, subnet mask and other information. Type /sbin/ipconfig command to display IP address: $ /sbin/ifconfig

DIFFERENCES BETWEEN MAC AND IP ADDRESS:
1. MAC is the type of a number for network devices like Ethernet cards
IP addresses uniquely identify computers on the Internet, or on a local intranet
2.MAC addresses are assigned at the time hardware is manufactured.
IP addresses are assigned as part of connecting to a network.
3. MAC is the hardware address
IP is the software address
4. MAC is static in nature as it is designed by the manufacturer
IP is dynamic in nature as it is assigned by the router every time it gets connected to the network.

APPLE TALK:
Apple Computer developed the AppleTalk protocol suite to implement file transfer, printer sharing, and mail service among Apple systems using the LocalTalk interface built into Apple hardware.It is a multi-layered protocol providing internetwork routing, transaction and data stream service, naming service, and comprehensive file and print sharing.
The AppleTalk design rigorously followed the OSI model of protocol layering.
Physical Layer has the responsibility of bit encoding/decoding, synchronization, signal transmission/ reception and carrier sensing.

The AppleTalk Link Access Protocol (ALAP) must be common to all systems on the network bus and handles the node-to-node delivery of data between devices connected to a single AppleTalk network.

In the Transport Layer, several protocols exist to add different types of functionality to the underlying services. The AppleTalk Transaction Protocol, or ATP, is part of the Transport Layer and is responsible for controlling the transactions (flow of data) between requestor and responder sockets.

In the Session Layer, the AppleTalk Session Protocol (ASP) is a general protocol designed to interact with ATP to provide for establishing, maintaining and closing sessions.

AppleTalk Filing Protocol (AFP) is a presentation layer protocol designed to control access to remote file systems.

HOW TO CHECK IP ADDRESS:
Here u need to have Apple Computer running Mac OSX.
Then the set of instructions should be followed.
1.Click the Apple logo on the top left of the screen.
2.Select “System Preferences”.
3.Select “Network” under the “Internet and Network” section.
4.Select which connection you’d like to check in the “Show” drop-down menu. If you’re hooked up via ethernet, select “Built In Ethernet”. If you have a wireless network, select “AirPort”.
5.Select “TCP/IP” on the “Network” screen. Your IP Address will be shown here.

Categories: Group13_AVANI

Group13_Avani: Apple talk videos

October 7, 2009 Leave a comment
Categories: Group13_AVANI

Group13_Avani: Description of Application layer

October 7, 2009 Leave a comment

Application layer enables the user to access the network. It provides user interfaces and support for services such as electronic mail, remote file access and transfer, shared database management and other types of distributed information services.
The user sends the message which may be in any format to the application layer. From there it is processed and sent to the presentation layer. No headers or trailers are added at this layer. That is no extra bit of information is added by the application layer as it is the message which needs to be sent to the user at the other end.
Services provided by the application layer includes
1.Network virtual terminal: A network virtual terminal is a software version of a physical terminal and allows the user to log on to a remote host.
2.File transfer, access and management (FTAM): This application allows user to access files in a remote computer, to retrieve files from remote computer, and to manage or control files in a remote computer.
3.Mail services: This application provides basis for email forwarding and storage.
4.Directory services: This application provides distributed database sources and access for global information about various objects and services.
Examples for protocols in this layer are HTTP (Hyper Text Transfer Protocol), FTP(File transfer Protocol), BOOTP(Bootstrap protocol), SSH(Secure Shell), SLP(Service Location Protocol) etc.

Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. Its use for retrieving inter-linked resources led to the establishment of the World Wide Web.
HTTP is a request/response standard of a client and a server. A client is the end-user; the server is the web site. The client making an HTTP request—using a web browser, spider, or other end-user tool—is referred to as the user agent. The responding server—which stores or creates resources such as HTML files and images—is called the origin server. In between the user agent and origin server may be several intermediaries, such as proxies, gateways, and tunnels. HTTP is not constrained to using TCP/IP and its supporting layers, although this is its most popular application on the Internet. Indeed HTTP can be “implemented on top of any other protocol on the Internet, or on other networks.” HTTP only presumes a reliable transport; any protocol that provides such guarantees can be used.”

File Transfer Protocol (FTP) is a standard network protocol used to exchange and manipulate files over an Internet Protocol computer network, such as the Internet. FTP is built on client-server architecture and utilizes separate control and data connections between the client and server applications. Client applications were originally interactive command-line tools with a standardized command syntax, but graphical user interfaces have been developed for all desktop operating systems in use today. FTP is also often used as an application component to automatically transfer files for program internal functions. FTP can be used with user-based password authentication or with anonymous user access.It is the simplest way to exchange files between computers on the Internet. Like the Hypertext Transfer Protocol (HTTP), which transfers displayable Web pages and related files, and the Simple Mail Transfer Protocol (SMTP), which transfers e-mail, FTP is an application protocol that uses the Internet’s TCP/IP protocols.

Categories: Group13_AVANI

Group13_Avani: Status report

October 5, 2009 Leave a comment

• Team Name : Avani

• Team Members : Bhavya K (1ms07is015), Meera B C (1ms07is049), Pooja P (1ms07is067),
Sushma Mallesh (1ms07is138)

• Group A Project Chosen : Protocol Stack and Addressing

• Group B Project Chosen : Error detection and correction

• Presentation Date of Group A Project : 23 sept 2009 (completed)

• Presentation Date of Group B Project : 28 oct 2009(not completed as on 5 oct 2009)

• Group A PPT Uploaded : Yes

• Group B PPT Uploaded : No

• Group A Project Report Made : No

• Group B Project Report Made : No

• Group A Project problems-faced-and-solved blog uploaded : Yes

• Group B Project problems-faced-and-solved blog uploaded : No

Categories: Group13_AVANI
Follow

Get every new post delivered to your Inbox.