Fountain Multimedia Broadcasting Final Report Spring Semester 2012

Size: px
Start display at page:

Download "Fountain Multimedia Broadcasting Final Report Spring Semester 2012"

Transcription

1 Fountain Multimedia Broadcasting Final Report Spring Semester Full Report- By Aqeel Alhashim Ben Kappel Jassim Alhashim Prepared to partially fulfill the requirements for ECE402 Department of Electrical and Computer Engineering Colorado State University Fort Collins, Colorado Project advisor: Dr. J Rockey Lou

2 Abstract Multimedia broadcasting has recently become a major topic as digital media demand has increased. As network speeds increase we will continue to see a move towards more efficient digital multimedia broadcasting methods. Current multimedia streaming methods are very inefficient using UDP with complex error correction coding, and TCP with an acknowledgement signal. Our hypothesis is that fountain coding can be shown to improve speed, efficiency, and increase the number of simultaneous clients streaming from a multimedia source. By coding and testing fountain coding algorithms we will be able to accurately test this hypothesis against current error correction algorithms. The objective of this project is to use fountain-broadcasting algorithm for streaming media to achieve higher speeds and improved efficiency compared to the current retransmission scheme and forward error correction methods. Our first stage was to make a multimedia streaming application with the proper feedback that would be required for our transmission and error correction algorithms. Our two media streaming programs consisted of; UDP with selective TCP feedback, and traditional TCP with feedback. Our primary focuses were learning network programming, designing and implementing a streaming media application, and researching streaming media transmission and error correction methods. Our current application uses UDP to stream media while providing selective TCP feedback to be used with the fountain code algorithm implemented in the future. Future research focus will be on reducing latency gain for large multicast loads by implementing and testing the fountain code algorithm. Overall there was an increase in latency for an increase in clients for the traditional TCP method. This project will be continued next semester. ii

3 TABLE OF CONTENTS Title Abstract Table of Contents List of Figures and Tables i ii iii iv I. Introduction 1 II. Previous and Current Multimedia Stream Methods 3 III. Previous Studies of Fountain Code 5 IV. Summary of Current Work 7 V. Ethical Issues 8 VI. Future Work 9 VII. Conclusion 10 References 11 Appendix A - Abbreviations 12 Appendix B Budget 13 Appendix C Code 14 iii

4 LIST OF FIGURES Figure 1 - TCP/IP packet transmission 3 Figure 2 - UDP with forward error correction code 4 Figure 3 - Example of Fountain Code 5 Figure 4: Example of Fountain Code Encoding/Decoding Equations 6 iv

5 Chapter I: Introduction Multimedia broadcasting, in the past few years, has seen a drastic increase in demand by everyday consumers. A study done by the Pew Research Center in 2010 showed that seven in ten Internet users have used the Internet for downloading or streaming video. It is also obvious that video uploads are popular. The website YouTube is one of the largest sources of user shared media and is increasing in users that download and upload everyday. Multimedia broadcasting has also seen an increase in digital multimedia subscription services. Services such as Netflix, Hulu, Comcast, and Blockbuster have increased the demand for streaming movies to a client s home. This move towards a digital rental service has increased the amount of data that is transferred over networks. Current protocol methods such as user datagram protocol and transmission control protocol are the most commonly used, and each has their advantages and disadvantages. TCP/IP has an acknowledgement packet to ensure error free transmissions, but is slow. Major issues for TCP transmission of media are: - Requires packet retransmission so long as any receiver does not receive the packet. - Requires feedback for every packet. - High latency in multicast applications with a large number of clients. An alternative to gain speed is UDP, but UDP is also very unreliable and requires complex code to be effective in media streaming applications. The major problems of UDP to stream multimedia are: - Fixed redundancy rate irrespective of the channel condition. - Unnecessary redundancy if the channel is good. - Transmission failure if packet erasure rate exceeds expectation. Fountain coding uses user datagram protocol combined with an error correction algorithm that is purely decoded on the receiver side. This uses the speed of UDP mixed with a high reliability to reduce the problems with common UDP and TCP/IP protocols. Some of the major of advancements that fountain coding provide are: - Rate-less transmission, the server sends out encoded packets in any order, and the receivers can decode the data from the given set. - No retransmission of lost packets, just needs to receive more packets to decode. - Selective feedback. - Adaptability between bad and good channel quality. Our goal to initialize this project was to create the programs needed to test fountain code algorithms by researching network programming, research multimedia streaming, and produce a final product to be tested. Our primary goals of this part of the project are to create a couple of multimedia streaming programs. We will need various programs to test the fountain code, and some other programs to be able to compare fountain code to other coding algorithms. We have created two multimedia streaming programs one using TCP with the traditional feedback, and a second using UDP to test fountain coding. The first program is 1

6 adaptable to multiple clients determined at run time. This program also has some sort of measurement of the total latency taken as a function of the number of clients currently streaming the media. Latency measurement is essential to show better performance of a particular method of streaming. The second program is aimed at testing fountain code. Fountain code requires a fast downlink combined with a selective and reliable feedback. For this program we used UDP to send the multimedia stream and TCP to provide a reliable feedback mechanism. We also have a method to ensure that the feedback is selective. These two programs are described in detail in Chapter IV. The second and main goal of this overall project is to test a proprietary fountain algorithm against traditional methods of streaming media. This is essential as a continuation of this project and will be the main focus of the final results. For this half of the project it was required to gain an understanding of how this fountain code will work to guarantee that the multimedia program that is created will be applicable to test fountain code. Our knowledge of fountain code is explained in Chapter III. 2

7 Chapter II: Previous and Current Multimedia Streaming Methods Current network protocols work correctly, however there are some problems that need to be addressed as data transfer size is growing and the number of clients receiving the data is increasing as well. We currently have two major methods of streaming video: - User Datagram Protocol (UDP) - Transmission Control Protocol (TCP) Both of these methods are currently used for different types of applications. First we will discuss TCP/IP and some applications that use this type of network transmission. TCP/IP applications include, but are not limited to: - - Internet Browsers - Computer IP addresses TCP/IP is a great protocol for reliability. It uses an acknowledgement signal from the receiver back to the sender to confirm that every packet has been received before sending the next packet in line. While very efficient for small files, it the server is sending large files and the network has a high error probability this will slow the transfer speed significantly. Below in Figure 1 we can see a basic picture of how the TCP/IP protocol sends and receives packets. Figure 1: TCP/IP packet transmission TCP when used for multicast multimedia streaming has major issues. If we have a number of clients, and one TCP multimedia server using acknowledgement signals to retransmit any lost packets, the server will eventually reach a maximum number of clients that can be effectively transmitted data. All network links have a probability for error due to unreliable routing schemes and other inconsistencies, and TCP is effective for 100% guaranteed transmission. However as the number of clients increase the total retransmission due to errors increases. If the amount of retransmission surpasses the amount of data sent successfully then no clients will receive original data and multimedia transmission will cease. This is a major problem with using TCP to stream multimedia to 3

8 multiple clients. Fountain code as explained in Chapter IV solves this major problem, while still providing a 100% guarantee of decoding original data at the receiving end. The second major type of network transmission protocol is the user datagram protocol or UDP for short. UDP is typically used where speed is essential. This method of sending data will not wait for an acknowledgement signal back and will keep sending packets regardless of whether the receiver has actually received them. Current methods of using UDP often use an extra error correction code attached to each packet so that the receiver can decode the original data if a packet is lost in transmission. Figure 2 below shows a method of attaching error correction code to a UDP packet. This method is called forward error correction or FEC for short. Figure 2: UDP with forward error correction code While this method of forward error correction eliminates the problem of reliability with UDP, it has a downside. The problem with UDP with FEC is that there is a high amount of redundancy. We can see above in Figure 2 that each packet has an error correction code added to the original data to allow the receiver to correct any missing packets. This turns a small file transfer into a much larger one and increases latency of this packet on the network. Another major problem with forward error correction coding schemes is a fixed redundancy rate. When using forward error correction an algorithm is specified for a maximum error that will be seen by the channel. Using forward error correction it is guaranteed that anything less then this predicted channel error would provide 100% guaranteed decoding of original packets on the receiving end. By providing encoding of original data for a maximum channel error rate, the overhead of encoding is fixed. If a channel consistently provides a lower error rate than was predicted, overhead latency is wasted. If a channel has a higher error rate than was predicted, then the forward error correction fails and the receiver cannot decode original data. 4

9 Chapter III: Previous Studies of Fountain Code Fountain code is a type of error correction algorithm using UDP transmission protocol. Few studies have been done about this type of error correction, as it is relatively new. Fountain code is a way to correct packet loss over a network. The basic theory behind this code is that it takes in packets of source data, encodes this data into an infinite number of packets. The server then sends out these packets randomly to a receiver or multiple receivers. The receiving end gathers as many packets as it needs to decode back to the original source data. The number of packets needed to decode the encoded data on the receiver side is larger then the original amount of packets, so a feedback transmission is needed to let the server know when to send more encoded packets. Shown below in Figure 3 is a basic diagram that explains, at a higher level, a basic form of fountain code. Figure 3: Example of Fountain Code From a paper (MacKay) written in 2005, there are three main types of fountain code: - Random Linear Fountain - LT Code - Raptor Code From these three types of code, Raptor code is the most efficient. Raptor code uses two types of LT code to make the fountain code more efficient. All of these codes use a generating matrix to encode the original source data. From this on the receiving end the received encoded packets can be combined with the inverse of the generating matrix to decode the original source data. Common fountain code encoding and decoding uses an algorithm based off of a bitwise sum, modulo 2. This can also be seen as an algorithm based off of a bitwise exclusive or, Boolean function. Another major type of fountain code that is presented is random linear fountain code. This code takes the original data packets and encodes them with an encoding function that can be represented by the equation below. Similarly on the receiving end the encoded packets that have been received without error can be decoded by using the equation shown below. To encode the original data the transmitted packet is set to a bitwise sum, modulo2 of the source packets for which G nk is 1. On the receiving end the original packet can be decoded using the inverse of this matrix. 5

10 Figure 4: Example of Fountain Code Encoding/Decoding Equations The above equations have two unlisted variables G. Radom linear fountain code uses a random generating matrix where a set of bits, K define each column of this matrix. The generating matrix G can then be created using any assortment of numbers; an example could be a deterministic random number generator. In this example the random number generator decoding the data on the receiving end is required to be synchronized to the senders encoding matrix in order to successfully decode the original data. A requirement of random linear fountain code is that that the number of received packets be larger than the number of original packets used to encode the data. In this case it would require that the number of received packets, N, be larger than the number of original packets encoded in the algorithm, K. If the number of packets N is less than K then the receiving end will be unable to decode the original data. This is when the feedback TCP signal will be used. It will request for more packets to be sent from the server. If N=K the receiver should be able to decode the original data, but for consistency often it is required that N>K. Next semester will be dedicated to testing a proprietary algorithm for fountain code. Once successful the algorithm will provide a lower complexity of encoding and decoding the data. Current fountain code research is aimed at reducing the complexity of the algorithm. Raptor code and LT code provide lower complexity than random linear fountain code. As fountain code gains more research support we will se an increase in the number of streaming applications to use this method of erasure code. 6

11 Chapter IV: Summary of Current Work The code we have designed includes two important parts. The first major part is streaming the video using UDP. UDP is used to provide the speed required in streaming media. By using an algorithm for fountain code, UDP can be very reliable. UDP is a fast way to send packets through the Internet since there is no connection made between the server and clients. It is also more efficient for sending to multiple clients at the same time. Part of our code is streaming video using UDP, which is provided by the server program. The server will be waiting for a request from a client to start streaming media to a client using what is called a fork() function. Fork() allows the server to stream video for more than one client simultaneously, while also allowing more connections to be made. The second part of our code is using a TCP connection. This kind of connection provides a reliable method of feedback, but at a cost of increasing the latency of the stream. We used TCP in the client to tell the server that client has enough packets or cannot decode the original data and needs more packets. The TCP connection is used as a single signal switch to pause or continue the server media stream. This on or off switch depends on whether a client can decode the original data successfully from the received data as explained in Chapter III. The sever source code provides three major functions. First, the server will be waiting to receive a request from any client to start streaming the video. When the server receives a request, it will create a process to take care of the requested client. When the process is created, it will start a media stream to that client. The server is also waiting for another request from any number of clients. In the client source code, the program will start receiving the stream and send the data to a media player when a specified buffer minimum is reached. When the client has enough packets to successfully decode the original data a signal will be sent to the server using TCP connection to tell it stop sending encoded packets. When the server receives this signal it will stop streaming the media while waiting for another signal to continue streaming. Once the client has successfully received all of the media, the server can terminate this process and continue to stream to other connected clients. This code can be found in Appendix C. Our second code was a basic TCP streaming server and client. This code was relatively easy to make, but we needed additions to add timing ability and overall latency calculations. All that was changed in this code from the previous code was the method of streaming media. 7

12 Chapter V: Ethical Issues The major ethical issues with any software release are in the functionality and implementation of the source code. Source code can be divided into a couple of categories including licensed, copyrighted, public domain, and illegal code. Licensed code usually contains rules that contain proper use information. Copyrighted code is free to use, but credit must be given to the author. Public domain code is free to use because it has no official author. Illegal code is code that is stolen from an application and released without the company s knowledge. Fortunately, our program uses all open source code with the built in libraries for C. The only section of our code that contains another application is the playback of the video, but essentially playback is not necessary for our final product release. Playback is only used in this project to confirm that our program is working correctly. If we were to release a multimedia streaming application that uses our final proprietary algorithm we would have to add a couple of additions to our program. The first addition would have to be a custom made streaming method. This would take some research in how to playback video and create a player in C. We would also need to create a easy to use graphical user interface as our program runs from command line only, and most users would not prefer to run our program using this method. The next ethical issue with our program involves ensuring that it has proper security, and no known flaws. When software is released to a user the company or seller has to guarantee that the information used is secure and that the program will not cause something to fault on their system. Currently our program has little to no safeguards. We are using it for research and testing. If we were to create a final product and release it, we would have to add error checking to our program, and possibly an encryption method to the data that is transferred. Adding these two things we would be able to confirm that our product is ethically safe for the user to use. Our final ethical issue that could arise with the future implementation of the proprietary algorithm is patents or copyrights. If this was a major upgrade to current streaming multimedia methods, then CSU may want to hold a right to the algorithm. Also the research findings paper must be accurate and have many test cases. If this paper does not test all the cases then an ethics issue may arrive. In conclusion we do not have many ethics issues to worry about with the current status of our project. We have uses C coding to create a completely custom multimedia streaming program that should not use any copyrighted libraries. We have not yet implemented the algorithm, but when this is implemented some ethics issues may arise. Also in the final paper and research submission more ethical issues may arise. If our project had other goals, such as selling a new multimedia streaming application that is faster and more efficient then current ones, then we would have a lot of ethical issues to deal with. Shown above are all the ethical issues we may have with our project. 8

13 Chapter VI: Future Work By the end of this semester and after we have successfully accomplished the goals that we have set for this semester which were building UDP streaming multimedia program which has many assignments under that main part like using C programming language to design a sender (server) and receiver (client) programs in order to transmit the data through the network, splitting our data into small multiple packets, and using UDP as transmitter on our program. Then we tested our UDP streaming program and after we had tested our program we find out that it has some problems like the quality of the data and that our sender program sending more packets than we need. As result of that we will need to set other goals in addition to the goals that we have already set in the timeline and these goals will be the adding a feedback to the receiver side and encoding/decoding. Our major future goal is implementing the fountain code to our UDP program and that will be in multiple steps. First step is writing the fountain code using the C program language, and this program will have the mixing matrix in order to encoding the source data and decoding the encoded data to get the original data after the transmission between the sender and receiver. The sender will have the fountain code, which will encode the data using the mixing matrix; on the other hand the receiver will have the fountain code, which will decode the encoded packets using the inverse of the mixing matrix, which will give us the original packets back. Second step will be using the feedback to inform the sender that the receiver side had received enough packets to decode them and get the original packets back and by that we will increase the efficiency by not sending more packets than needed. After we have done with implementing the fountain code to our UDP program, now we could move to the next goal which will be testing and research in order to find out if our project has solved the problem and that will be through making some testing in our program to find out how well our program is working, then in the research part we could compare our results with other projects and researches about this topic to find out how efficient our program and if we have accomplished the goal of our project. 9

14 Chapter VII: Conclusion Streaming media has increased in demand, size, and speed as technology has advanced. The current protocol methods for streaming media efficiently are a significant bottleneck in the speed of streaming media. TCP and UDP methods have significant problems with efficiency and speed, and using UDP with fountain code algorithms is a good way to eliminate these problems. This semester we have finished a UDP streaming program, which is the base for testing the fountain code error correction. We have also created a traditional streaming program as well. Finally, we also took a lot of time to study and understand how current fountain code is used and implemented. Once we start testing fountain code we will be able to see if our hypothesis is confirmed or refuted. So far based on looking at past studies in fountain code, it is evident that fountain code can be more efficient. We will devote all of future research to fountain code testing. 10

15 References Kristen Purcell, The State of Online Video, Pew Internet & American Life Project, Jun 3, 2010, Dec 7, MacKay, D.J.C.;, "Fountain codes," Communications, IEE Proceedings-, vol.152, no.6, pp , 9 Dec doi: /ip-com: Figure 1 - htp:// Figure Figure Figure 4 - MacKay, D.J.C.;, "Fountain codes," 11

16 Appendix A Abbreviations UDP User Datagram Protocol TCP Transmission Control Protocol LT code Luby Transform code FEC Forward Error Correction 12

17 Appendix B - Budget We have a budget of three hundred dollars. Fortunately we can do all of our programming on our personal computers. We needed some of the budget to print out materials for E-Days. 13

18 Appendix C Code Sender: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> // argv[1]: the ip // argv[2]: the port // argv[3]: the file int main(int argc, char *argv[]) /*int w; int numrecv = atoi(argv[1]); pid_t child_pid[numrecv]; for( w = 0; w<numrecv; w++) if ((child_pid[i] = fork()) < 0) perror("fork"); abort(); else if (child_pid[i] == 0) */ // int recvpkg; int i = 0 ; int j = 0; int wait = 0; unsigned short pkgno = 0; char * msg = (char *)malloc(2); // // tcp variables and structure int sock_tcp; struct addrinfo hints_tcp, *result_tcp; memset(&hints_tcp, 0, sizeof hints_tcp); hints_tcp.ai_family = AF_UNSPEC; hints_tcp.ai_socktype = SOCK_STREAM; //udp variables and structure int sock_udp; struct addrinfo hints_udp, *result_udp; memset(&hints_udp, 0, sizeof hints_udp); hints_udp.ai_family = AF_UNSPEC; hints_udp.ai_socktype = SOCK_DGRAM; //tcp functions getaddrinfo(argv[1], argv[2], &hints_tcp, &result_tcp); sock_tcp = socket(result_tcp->ai_family, result_tcp->ai_socktype, result_tcp->ai_protocol); connect(sock_tcp, result_tcp->ai_addr,result_tcp->ai_addrlen); printf("done tcp\n"); // i = recv(sock_tcp, msg, 10, 0); *(msg+i) = '\0'; printf("%s\n",msg); // //udp functions if (getaddrinfo(argv[1], argv[2], &hints_udp, &result_udp)!= 0) printf("error getaddrinfo()\n"); sock_udp = socket(result_udp->ai_family, result_udp->ai_socktype, result_udp->ai_protocol); if (sock_udp == -1) printf("error socket()\n"); printf("done UDP\n"); // // // open the file to be sent FILE *rfile = fopen(argv[3], "rb"); fseek(rfile, 0, SEEK_END); int filesize = ftell(rfile); rewind(rfile); char *resend[(filesize/1022)+1]; //============================================================================================- //store packeges for resending for (i = 0; i<((filesize/1022)+1); i++) 14

19 resend[i] = (char *)malloc(1024); char * buffer = (char *)malloc(1024); i = 0; // sending file while(1) *buffer = (char )(pkgno>>8); *(1+buffer) = (char)(pkgno); i = fread((2+buffer), 1, 1022, rfile);// two bytes for the packet numebr memcpy(resend[pkgno], buffer, i);//resend packet // send packet if (rand()%10!=1 pkgno >= ((filesize/1022)+1)) if (sendto(sock_udp, buffer, (i+2), 0, result_udp->ai_addr, result_udp->ai_addrlen) == -1) printf("error sendto()\n"); return 0; else // advance one packet to do miss pkgno++; *buffer = (char)(pkgno>>8); *(1+buffer) = (char)(pkgno); i = fread((2+buffer), 1, 1022, rfile);// two bytes for the packet numebr memcpy(resend[pkgno], buffer, i);//copy to a buffer for resendinf later if (sendto(sock_udp, buffer, (i+2), 0, result_udp->ai_addr, result_udp->ai_addrlen) == -1) printf("error sendto()\n"); return 0; //the received pakacts // // recv(sock_tcp, msg, 3, 0); // recvpkg= (unsigned short)*msg; // recvpkg<<=8; // recvpkg+= 255&(unsigned short)*(1+msg); // // // if (recvpkg < pkgno) // resend recvpkg and pkgno sendto(sock_udp, resend[recvpkg], (i+2), 0, result_udp->ai_addr, result_udp->ai_addrlen); while(wait!=5000) wait++; wait = 0; sendto(sock_udp, resend[pkgno], (i+2), 0, result_udp->ai_addr, result_udp->ai_addrlen); else /*printf("recv %d\n", recvpkg);*/ if( i == 0) printf("break loop\n"); break; while(wait!=5000) wait++; wait = 0; pkgno++; return 0; 15

20 Receiver: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> /** * getpkgno: functiont to get the packet number from the packets. * pkgno: is an unsigned short variable to store the packet numebr in. * buffer: has the packet that got received. */ void getpkgno(unsigned short *pkgno, char *buffer) *pkgno= (unsigned short)*buffer; *pkgno<<=8; *pkgno+= 255&(unsigned short)*(1+buffer); /** * main:the main function, * argv[1]: port * argv[2]: outfile */ int main(int argc, char *argv[]) int j = 0; // wait for write file to be enough for playing unsigned short pkgno = 0; unsigned short PrepkgNo = 0; int i = 0; char *c = (char *)malloc(2); FILE *wfile = fopen(argv[2], "wb"); char *buffer = (char *)malloc(1024); // //tcp variables and structures struct sockaddr_storage their_addr_tcp; // connector's address information socklen_t sin_size; int sock_tcp, new_fd; struct addrinfo hints_tcp, *result_tcp; memset(&hints_tcp, 0, sizeof hints_tcp); hints_tcp.ai_family = AF_UNSPEC; hints_tcp.ai_socktype = SOCK_STREAM; hints_tcp.ai_flags = AI_PASSIVE; //udp variables and structure int sock_udp; struct addrinfo hints_udp, *result_udp; struct sockaddr_storage their_addr_udp; socklen_t addrlen; memset(&hints_udp, 0, sizeof hints_udp); hints_udp.ai_family = AF_UNSPEC; hints_udp.ai_socktype = SOCK_DGRAM; hints_udp.ai_flags = AI_PASSIVE; //tcp functions getaddrinfo(null, argv[1], &hints_tcp, &result_tcp); sock_tcp = socket(result_tcp->ai_family, result_tcp->ai_socktype, result_tcp->ai_protocol); bind(sock_tcp, result_tcp->ai_addr, result_tcp->ai_addrlen); printf("listening...\n"); listen(sock_tcp, 10); new_fd = accept(sock_tcp,(struct sockaddr *)&their_addr_tcp, &sin_size ); printf("tcp accept\n"); //udp functions getaddrinfo(null, argv[1], &hints_udp, &result_udp); sock_udp = socket(result_udp->ai_family, result_udp->ai_socktype, result_udp->ai_protocol); bind(sock_udp, result_udp->ai_addr, result_udp->ai_addrlen); printf("udp bind\n"); // send(new_fd, "go", 2, 0); printf("waiting to receive\n"); // receiving file while(1) i = recvfrom(sock_udp, buffer, 1024, 0, (struct sockaddr *)&their_addr_udp, &addrlen); *c = *buffer; *(c+1) = *(1+buffer); getpkgno(&pkgno, buffer); // lost packets if((pkgno - PrepkgNo) > 1) *c = (char )((pkgno-1)>>8); *(1+c) = (char)(pkgno-1); send(new_fd, c, 2, 0); // Send the lost packet i = recvfrom(sock_udp, buffer, 1024, 0, (struct sockaddr *)&their_addr_udp, &addrlen); getpkgno(&pkgno, buffer); 16

21 printf("recv %d and ", pkgno); if( (i-2) == 0) printf("break\n");break; fwrite((2+buffer),(i-2), 1,wFile); i = recvfrom(sock_udp, buffer, 1024, 0, (struct sockaddr *)&their_addr_udp, &addrlen); getpkgno(&pkgno, buffer); printf("%d\n", pkgno); else printf("recv %d\n", pkgno); send(new_fd, c, 2, 0);// send the packet received if( (i-2) == 0)// to get out of the loop printf("break\n"); return 0; fwrite((2+buffer),(i-2), 1,wFile); /*if( j == 500) char *temp[22]; sprintf(temp,"%s%s%s","mplayer ", argv[2], " &"); system(temp); */ PrepkgNo = pkgno; pkgno = 0; j++; return 0; 17

CSE 333 SECTION 7. Client-Side Network Programming

CSE 333 SECTION 7. Client-Side Network Programming CSE 333 SECTION 7 Client-Side Network Programming Overview Domain Name Service (DNS) Client side network programming steps and calls dig and ncat tools Network programming for the client side Recall the

More information

CSE 333 Section 8 - Client-Side Networking

CSE 333 Section 8 - Client-Side Networking CSE 333 Section 8 - Client-Side Networking Welcome back to section! We re glad that you re here :) Networking Quick Review What are the following protocols used for? (bonus: what layer of the networking

More information

CSE 333 SECTION 7. C++ Virtual Functions and Client-Side Network Programming

CSE 333 SECTION 7. C++ Virtual Functions and Client-Side Network Programming CSE 333 SECTION 7 C++ Virtual Functions and Client-Side Network Programming Overview Virtual functions summary and worksheet Domain Name Service (DNS) Client side network programming steps and calls dig

More information

CSE 333 SECTION 8. Sockets, Network Programming

CSE 333 SECTION 8. Sockets, Network Programming CSE 333 SECTION 8 Sockets, Network Programming Overview Domain Name Service (DNS) Client side network programming steps and calls Server side network programming steps and calls dig and ncat tools Network

More information

Client-side Networking

Client-side Networking Client-side Networking CSE 333 Autumn 2018 Instructor: Hal Perkins Teaching Assistants: Tarkan Al-Kazily Renshu Gu Trais McGaha Harshita Neti Thai Pham Forrest Timour Soumya Vasisht Yifan Xu Administriia

More information

Azblink API for Sending XMPP Messages via HTTP POST

Azblink API for Sending XMPP Messages via HTTP POST Azblink API for Sending XMPP Messages via HTTP POST Abstract: This document is to describe the API of Azblink SBC for sending XMPP messages via HTTP POST. This is intended for the systems or the devices

More information

The Berkeley Sockets API. Networked Systems Architecture 3 Lecture 4

The Berkeley Sockets API. Networked Systems Architecture 3 Lecture 4 The Berkeley Sockets API Networked Systems Architecture 3 Lecture 4 The Berkeley Sockets API Widely used low-level C networking API First introduced in 4.3BSD Unix Now available on most platforms: Linux,

More information

CSE 333 SECTION 7. Client-Side Network Programming

CSE 333 SECTION 7. Client-Side Network Programming CSE 333 SECTION 7 Client-Side Network Programming Overview Homework 3 due tonight Questions? Domain Name Service (DNS) Review Client side network programming steps and calls intro dig tool Network programming

More information

CSE 333 Section 3. Thursday 12 April Thursday, April 12, 12

CSE 333 Section 3. Thursday 12 April Thursday, April 12, 12 CSE 333 Section 3 Thursday 12 April 2012 Goals for Today 1. Overview IP addresses 2. Look at the IP address structures in C/C++ 3. Overview DNS 4. Talk about how to use DNS to translate IP addresses 5.

More information

Network Programming in C: The Berkeley Sockets API. Networked Systems 3 Laboratory Sessions

Network Programming in C: The Berkeley Sockets API. Networked Systems 3 Laboratory Sessions Network Programming in C: The Berkeley Sockets API Networked Systems 3 Laboratory Sessions The Berkeley Sockets API Widely used low-level C networking API First introduced in 4.3BSD Unix Now available

More information

Network Programming in C. Networked Systems 3 Laboratory Sessions and Problem Sets

Network Programming in C. Networked Systems 3 Laboratory Sessions and Problem Sets Network Programming in C Networked Systems 3 Laboratory Sessions and Problem Sets Lab Timetable, Aims, and Objectives Teaching Week Activity 14 Introduction 15 Warm-up exercise 16 17 Web client 18 19 20

More information

6 장과제샘플코드 - 다자간채팅 (udp 버전 1) 목포해양대해양컴퓨터공학과

6 장과제샘플코드 - 다자간채팅 (udp 버전 1) 목포해양대해양컴퓨터공학과 6 장과제샘플코드 - 다자간채팅 (udp 버전 1) 과제 서버에서먼저 bind 하고그포트를다른사람에게알려줄것 클라이언트들은알려준포트로접속 서버는클라이언트로부터받은메시지를다른클라이언트들에게전달 2 Makefile 1 SRC_DIR =../../common 2 COM_OBJS = $(SRC_DIR)/addressUtility.o $(SRC_DIR)/dieWithMessage.o

More information

CSE 333 SECTION 6. Networking and sockets

CSE 333 SECTION 6. Networking and sockets CSE 333 SECTION 6 Networking and sockets Overview Network Sockets IP addresses and IP address structures in C/C++ DNS Resolving DNS names Demos Section exercise Sockets Network sockets are network interfaces

More information

Computer Network Programming

Computer Network Programming Practical Programming Computer Network Programming Marwan Burelle & David Bouchet david.bouchet.epita@gmail.com 1 Quick Overview 1.IP and Protocol Stack 2.TCP Concepts 3.Client / Server Concepts 4.Socket

More information

Outline. Option Types. Socket Options SWE 545. Socket Options. Out-of-Band Data. Advanced Socket. Many socket options are Boolean flags

Outline. Option Types. Socket Options SWE 545. Socket Options. Out-of-Band Data. Advanced Socket. Many socket options are Boolean flags Outline SWE 545 Socket Options POSIX name/address conversion Out-of-Band Data Advanced Socket Programming 2 Socket Options Various attributes that are used to determine the behavior of sockets Setting

More information

2007 Microsoft Corporation. All rights reserved.

2007 Microsoft Corporation. All rights reserved. Creating a Basic Winsock Application 2007 Microsoft Corporation. All rights reserved. To create a basic Winsock application 1. Create a new empty project. 2. Add an empty C++ source file to the project.

More information

IP Addresses, DNS. CSE 333 Spring Instructor: Justin Hsia

IP Addresses, DNS. CSE 333 Spring Instructor: Justin Hsia IP Addresses, DNS CSE 333 Spring 2018 Instructor: Justin Hsia Teaching Assistants: Danny Allen Dennis Shao Eddie Huang Kevin Bi Jack Xu Matthew Neldam Michael Poulain Renshu Gu Robby Marver Waylon Huang

More information

1 /* client.c - adapted from code for example client program that uses TCP */ 2 /*Modified by Vincent Chu, Winter

1 /* client.c - adapted from code for example client program that uses TCP */ 2 /*Modified by Vincent Chu, Winter 1 /* client.c - adapted from code for example client program that uses TCP */ 2 /*Modified by Vincent Chu, Winter 2004. 3 http://www.sfu.ca/~vwchu 4 chuvincent (at) gmail (dot) com 5 */ 6 7 #define closesocket

More information

UNIX Sockets. Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E.

UNIX Sockets. Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E. UNIX Sockets Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E. Socket and Process Communication application layer User Process Socket transport layer (TCP/UDP) network layer (IP)

More information

Introduction to Lab 2 and Socket Programming. -Vengatanathan Krishnamoorthi

Introduction to Lab 2 and Socket Programming. -Vengatanathan Krishnamoorthi Introduction to Lab 2 and Socket Programming -Vengatanathan Krishnamoorthi Before we start.. Soft deadline for lab 2- February 13 Finish assignment 1 as soon as possible if you have not yet. Hard deadline

More information

IP Addresses, DNS. CSE 333 Summer Teaching Assistants: Renshu Gu William Kim Soumya Vasisht

IP Addresses, DNS. CSE 333 Summer Teaching Assistants: Renshu Gu William Kim Soumya Vasisht IP Addresses, DNS CSE 333 Summer 2018 Instructor: Hal Perkins Teaching Assistants: Renshu Gu William Kim Soumya Vasisht Lecture Outline Network Programming Sockets API Network Addresses DNS Lookup 2 Files

More information

CSE 333 Lecture 16 - network programming intro

CSE 333 Lecture 16 - network programming intro CSE 333 Lecture 16 - network programming intro Hal Perkins Department of Computer Science & Engineering University of Washington Today Network programming - dive into the Berkeley / POSIX sockets API -

More information

CS 3516: Computer Networks

CS 3516: Computer Networks Welcome to CS 3516: Prof. Yanhua Li Time: 9:00am 9:50am M, T, R, and F Location: AK219 Fall 2018 A-term 1 Some slides are originally from the course materials of the textbook Computer Networking: A Top

More information

CSC310 Information Theory. Lecture 21: Erasure (Deletion) Channels & Digital Fountain Codes. November 22, 2006 see

CSC310 Information Theory. Lecture 21: Erasure (Deletion) Channels & Digital Fountain Codes. November 22, 2006 see CSC310 Information Theory Lecture 21: Erasure (Deletion) Channels & Digital Fountain Codes Sam Roweis Recovering From Erasures 2 How can we recover from erasures? For the BEC, we saw that low-density parity

More information

Introduction to Client-Server Model

Introduction to Client-Server Model Preview Introduction to Client-Server Model Motivation of Client-Server Model Terminologies and Concepts in Client-Server Model Connectionless vs. Connection-Oriented Stateless vs. Stateful Server Identify

More information

CSC310 Information Theory. Lecture 22: Erasure (Deletion) Channels & Digital Fountain Codes. November 30, 2005 see

CSC310 Information Theory. Lecture 22: Erasure (Deletion) Channels & Digital Fountain Codes. November 30, 2005 see CSC310 Information Theory Lecture 22: Erasure (Deletion) Channels & Digital Fountain Codes Sam Roweis Recovering From Erasures 2 How can we recover from erasures? For the BEC, we saw that low-density parity

More information

Redesde Computadores(RCOMP)

Redesde Computadores(RCOMP) Redesde Computadores(RCOMP) Theoretical-Practical (TP) Lesson 06 2016/2017 Berkeley sockets API, C and Java. Address families and address storing. Basic functions/methods for UDP applications. UDP client

More information

ENGN8637. Advanced Topics in Communications. Your Title

ENGN8637. Advanced Topics in Communications. Your Title ENGN8637 Advanced Topics in Communications Your Title Your name uxxxxxxxx@anu.edu.au Research School of Engineering, ANU submitted on 18/March/2018 Contents 1 Introduction 1 2 A New Section 3 3 Yet another

More information

ELEC 691X/498X Broadcast Signal Transmission Winter 2018

ELEC 691X/498X Broadcast Signal Transmission Winter 2018 ELEC 691X/498X Broadcast Signal Transmission Winter 2018 Instructor: DR. Reza Soleymani, Office: EV 5.125, Telephone: 848 2424 ext.: 4103. Office Hours: Wednesday, Thursday, 14:00 15:00 Slide 1 In this

More information

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP CS 5520/ECE 5590NA: Network Architecture I Spring 2008 Lecture 13: UDP and TCP Most recent lectures discussed mechanisms to make better use of the IP address space, Internet control messages, and layering

More information

Internetworking Models The OSI Reference Model

Internetworking Models The OSI Reference Model Internetworking Models When networks first came into being, computers could typically communicate only with computers from the same manufacturer. In the late 1970s, the Open Systems Interconnection (OSI)

More information

Unix Network Programming

Unix Network Programming Introduction to Computer Networks Polly Huang EE NTU Unix Network Programming The socket struct and data handling System calls Based on Beej's Guide to Network Programming 1 The Unix Socket A file descriptor

More information

Network Model: Each layer has a specific function.

Network Model: Each layer has a specific function. OBJECTIVES: To discuss the OSI model and its layer architecture and to show the interface between the layers. To briefly discuss the functions of each layer in the OSI model. To introduce the TCP/IP protocol.

More information

CSE 333 Lecture network programming intro

CSE 333 Lecture network programming intro CSE 333 Lecture 17 -- network programming intro Hal Perkins Paul G. Allen School of Computer Science & Engineering University of Washington Administrivia HW3 due Thursday night HW4 out Friday morning -

More information

CSC209H Lecture 9. Dan Zingaro. March 11, 2015

CSC209H Lecture 9. Dan Zingaro. March 11, 2015 CSC209H Lecture 9 Dan Zingaro March 11, 2015 Socket Programming (Kerrisk Ch 56, 57, 59) Pipes and signals are only useful for processes communicating on the same machine Sockets are a general interprocess

More information

목포해양대해양컴퓨터공학과. IPv6 적용

목포해양대해양컴퓨터공학과. IPv6 적용 IPv6 적용 1 IPV6 기본규격 2 IPv6 Basic header 3 IPv6 - Extension Headers (1) Hop-by-Hop Options (0) RSVP, PIM/MLD, etc. Routing (43) Source Routing, MIPv6 Fragment (44) Encapsulating Security Payload (50) IPsec

More information

Sockets. Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University Embedded Software Lab.

Sockets. Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University  Embedded Software Lab. 1 Sockets Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University http://nyx.skku.ac.kr Internet Connections (1) 2 Connection Clients and servers communicate by sending streams of bytes over

More information

Piotr Mielecki Ph. D.

Piotr Mielecki Ph. D. Piotr Mielecki Ph. D. http://mielecki.ristel.pl/ piotr.mielecki@pwr.edu.pl pmielecki@gmail.com Building blocks of client-server applications: Client, Server, Middleware. Simple client-server application:

More information

Socket Programming. #In the name of Allah. Computer Engineering Department Sharif University of Technology CE443- Computer Networks

Socket Programming. #In the name of Allah. Computer Engineering Department Sharif University of Technology CE443- Computer Networks #In the name of Allah Computer Engineering Department Sharif University of Technology CE443- Computer Networks Socket Programming Acknowledgments: Lecture slides are from Computer networks course thought

More information

NETWORK AND SYSTEM PROGRAMMING

NETWORK AND SYSTEM PROGRAMMING NETWORK AND SYSTEM PROGRAMMING LAB 16 ELEMENTARY UDP SOCKETS The UDP protocol is connectionless and adds unreliability to the application. Each packet that is sent by the client or server is not acknowledged

More information

Lec 19 - Error and Loss Control

Lec 19 - Error and Loss Control ECE 5578 Multimedia Communication Lec 19 - Error and Loss Control Zhu Li Dept of CSEE, UMKC Office: FH560E, Email: lizhu@umkc.edu, Ph: x 2346. http://l.web.umkc.edu/lizhu slides created with WPS Office

More information

Elementary TCP Sockets

Elementary TCP Sockets Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens Distributed Computer Systems 1 socket interface Application 1 Application 2 socket interface user kernel user kernel

More information

Processes communicating. Network Communication. Sockets. Addressing processes 4/15/2013

Processes communicating. Network Communication. Sockets. Addressing processes 4/15/2013 Processes communicating Network Communication Process: program running within a host. within same host, two processes communicate using inter-process communication (defined by OS). processes in different

More information

UNIX System Programming Lecture 19: IP Sockets

UNIX System Programming Lecture 19: IP Sockets UNIX System Programming Lecture 19: Outline Reference BLP: Chapter 15 man pages: socket, bind, connect, listen, accept, ip(7), ipv6(7), getaddrinfo, getnameinfo 1 Review of UNIX Sockets On the server,

More information

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture)

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture) Lecture 7: Sliding Windows CSE 123: Computer Networks Geoff Voelker (guest lecture) Please turn in HW #1 Thank you From last class: Sequence Numbers Sender Receiver Sender Receiver Timeout Timeout Timeout

More information

Sockets and Parallel Computing. CS439: Principles of Computer Systems April 11, 2018

Sockets and Parallel Computing. CS439: Principles of Computer Systems April 11, 2018 Sockets and Parallel Computing CS439: Principles of Computer Systems April 11, 2018 Last Time Introduction to Networks OSI Model (7 layers) Layer 1: hardware Layer 2: Ethernet (frames) SAN, LAN, WAN Layer

More information

OSI Layer OSI Name Units Implementation Description 7 Application Data PCs Network services such as file, print,

OSI Layer OSI Name Units Implementation Description 7 Application Data PCs Network services such as file, print, ANNEX B - Communications Protocol Overheads The OSI Model is a conceptual model that standardizes the functions of a telecommunication or computing system without regard of their underlying internal structure

More information

Context. Distributed Systems: Sockets Programming. Alberto Bosio, Associate Professor UM Microelectronic Departement

Context. Distributed Systems: Sockets Programming. Alberto Bosio, Associate Professor UM Microelectronic Departement Distributed Systems: Sockets Programming Alberto Bosio, Associate Professor UM Microelectronic Departement bosio@lirmm.fr Context Computer Network hosts, routers, communication channels Hosts run applications

More information

Network Communication

Network Communication Network Communication Processes communicating Process: program running within a host. q within same host, two processes communicate using inter- process communica6on (defined by OS). q processes in different

More information

Chapter Six. Errors, Error Detection, and Error Control. Data Communications and Computer Networks: A Business User s Approach Seventh Edition

Chapter Six. Errors, Error Detection, and Error Control. Data Communications and Computer Networks: A Business User s Approach Seventh Edition Chapter Six Errors, Error Detection, and Error Control Data Communications and Computer Networks: A Business User s Approach Seventh Edition After reading this chapter, you should be able to: Identify

More information

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1 OSI Transport Layer Network Fundamentals Chapter 4 Version 4.0 1 Transport Layer Role and Services Transport layer is responsible for overall end-to-end transfer of application data 2 Transport Layer Role

More information

UNIX Sockets. COS 461 Precept 1

UNIX Sockets. COS 461 Precept 1 UNIX Sockets COS 461 Precept 1 Socket and Process Communica;on application layer User Process Socket transport layer (TCP/UDP) OS network stack network layer (IP) link layer (e.g. ethernet) Internet Internet

More information

ICT 6544 Distributed Systems Lecture 5

ICT 6544 Distributed Systems Lecture 5 ICT 6544 Distributed Systems Lecture 5 Hossen Asiful Mustafa Message Brokers Figure 4-21. The general organization of a message broker in a message-queuing system. IBM s WebSphere Message-Queuing System

More information

UDP CONNECT TO A SERVER

UDP CONNECT TO A SERVER UDP The User Datagram Protocol Stefan D. Bruda Winter 2018 Very similar to the TCP in terms of API Dissimilar with TCP in terms of innards (and hence programming techniques) Many-to-many communication.

More information

CN1047 INTRODUCTION TO COMPUTER NETWORKING CHAPTER 6 OSI MODEL TRANSPORT LAYER

CN1047 INTRODUCTION TO COMPUTER NETWORKING CHAPTER 6 OSI MODEL TRANSPORT LAYER CN1047 INTRODUCTION TO COMPUTER NETWORKING CHAPTER 6 OSI MODEL TRANSPORT LAYER Transport Layer The Transport layer ensures the reliable arrival of messages and provides error checking mechanisms and data

More information

Week 2 / Paper 1. The Design Philosophy of the DARPA Internet Protocols

Week 2 / Paper 1. The Design Philosophy of the DARPA Internet Protocols Week 2 / Paper 1 The Design Philosophy of the DARPA Internet Protocols David D. Clark ACM CCR, Vol. 18, No. 4, August 1988 Main point Many papers describe how the Internet Protocols work But why do they

More information

CS4700/CS5700 Fundamentals of Computer Networks

CS4700/CS5700 Fundamentals of Computer Networks CS4700/CS5700 Fundamentals of Computer Networks Lecture 14: TCP Slides used with permissions from Edward W. Knightly, T. S. Eugene Ng, Ion Stoica, Hui Zhang Alan Mislove amislove at ccs.neu.edu Northeastern

More information

MSc Integrated Electronics Networks Assignment. Investigation of TCP/IP Sockets and Ports. Gavin Cameron

MSc Integrated Electronics Networks Assignment. Investigation of TCP/IP Sockets and Ports. Gavin Cameron MSc Integrated Electronics Networks Assignment Investigation of TCP/IP Sockets and Ports Gavin Cameron Introduction TCP and IP (Transmission Control Protocol / Internet Protocol) are two protocols from

More information

1.2 The first Internet (i.e., one of the first packet switched networks) was referred to as the ARPANET.

1.2 The first Internet (i.e., one of the first packet switched networks) was referred to as the ARPANET. CPSC 360 Spring 2011 Exam 1 Solutions This exam is closed book, closed notes, closed laptops. You are allowed to have one 8.5x11 sheets of paper with whatever you like written on the front and back. You

More information

Tutorial on Socket Programming

Tutorial on Socket Programming Tutorial on Socket Programming Computer Networks - CSC 458 Department of Computer Science Hao Wang (Slides are mainly from Seyed Hossein Mortazavi, Monia Ghobadi, and Amin Tootoonchian, ) 1 Outline Client-server

More information

9th Slide Set Computer Networks

9th Slide Set Computer Networks Prof. Dr. Christian Baun 9th Slide Set Computer Networks Frankfurt University of Applied Sciences WS1718 1/49 9th Slide Set Computer Networks Prof. Dr. Christian Baun Frankfurt University of Applied Sciences

More information

CS 4400 Fall 2017 Final Exam Practice

CS 4400 Fall 2017 Final Exam Practice CS 4400 Fall 2017 Final Exam Practice Name: Instructions You will have eighty minutes to complete the actual open-book, opennote exam. Electronic devices will be allowed only to consult notes or books

More information

CSCI-1680 Link Layer I Rodrigo Fonseca

CSCI-1680 Link Layer I Rodrigo Fonseca CSCI-1680 Link Layer I Rodrigo Fonseca Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Last time Physical layer: encoding, modulation Today Link layer framing Getting frames

More information

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University Sockets Hyo-bong Son (proshb@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Client-Server Model Most network application is based on the client-server model: A server

More information

Sockets. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Sockets. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Sockets Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Internet Connections (1) Connection Clients and servers communicate by sending streams of

More information

Ports under 1024 are often considered special, and usually require special OS privileges to use.

Ports under 1024 are often considered special, and usually require special OS privileges to use. 1 2 Turns out that besides an IP address (used by the IP layer), there is another address that is used by TCP (stream sockets) and, coincidentally, by UDP (datagram sockets). It is the port number. It's

More information

Chapter 3. The Data Link Layer. Wesam A. Hatamleh

Chapter 3. The Data Link Layer. Wesam A. Hatamleh Chapter 3 The Data Link Layer The Data Link Layer Data Link Layer Design Issues Error Detection and Correction Elementary Data Link Protocols Sliding Window Protocols Example Data Link Protocols The Data

More information

Internet Content Distribution

Internet Content Distribution Internet Content Distribution Chapter 1: Introduction Jussi Kangasharju Chapter Outline Introduction into content distribution Basic concepts TCP DNS HTTP Outline of the rest of the course Kangasharju:

More information

4 rd class Department of Network College of IT- University of Babylon

4 rd class Department of Network College of IT- University of Babylon 1. INTRODUCTION We can divide audio and video services into three broad categories: streaming stored audio/video, streaming live audio/video, and interactive audio/video. Streaming means a user can listen

More information

Transport Layer Protocols TCP

Transport Layer Protocols TCP Transport Layer Protocols TCP Gail Hopkins Introduction Features of TCP Packet loss and retransmission Adaptive retransmission Flow control Three way handshake Congestion control 1 Common Networking Issues

More information

ENGN4521/6521. Embedded Wireless. An LIPD Band RF Front End for DATV

ENGN4521/6521. Embedded Wireless. An LIPD Band RF Front End for DATV ENGN4521/6521 Embedded Wireless An LIPD Band RF Front End for DATV V3.0 Copyright 2014-2015 G.G. Borg College of Engineering and Computer Science. Australian National University 1 Contents 1 Foreword 3

More information

Midterm Exam Nov 8th, COMS W3157 Advanced Programming Columbia University Fall Instructor: Jae Woo Lee.

Midterm Exam Nov 8th, COMS W3157 Advanced Programming Columbia University Fall Instructor: Jae Woo Lee. Midterm Exam Nov 8th, 2012 COMS W3157 Advanced Programming Columbia University Fall 2012 Instructor: Jae Woo Lee About this exam: - There are 4 problems totaling 100 points: problem 1: 30 points problem

More information

Programming with TCP/IP. Ram Dantu

Programming with TCP/IP. Ram Dantu 1 Programming with TCP/IP Ram Dantu 2 Client Server Computing Although the Internet provides a basic communication service, the protocol software cannot initiate contact with, or accept contact from, a

More information

Winsock Server adding Multiple clients support C++

Winsock Server adding Multiple clients support C++ Winsock Server adding Multiple clients support C++ This is very simple version to add multiple connection support to your server project. Here we are going to use ioctlsocket to make it non blocking and

More information

Lecture 7. Followup. Review. Communication Interface. Socket Communication. Client-Server Model. Socket Programming January 28, 2005

Lecture 7. Followup. Review. Communication Interface. Socket Communication. Client-Server Model. Socket Programming January 28, 2005 Followup symbolic link (soft link): pathname, can be across file systems, replacement of file will be active on all symbolic links, consumes at least an inode. hard link: pointers to an inode, only in

More information

(Refer Slide Time: 1:09)

(Refer Slide Time: 1:09) Computer Networks Prof. S. Ghosh Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecturer # 30 UDP and Client Server Good day, today we will start our discussion

More information

Socket Programming. CSIS0234A Computer and Communication Networks. Socket Programming in C

Socket Programming. CSIS0234A Computer and Communication Networks. Socket Programming in C 1 CSIS0234A Computer and Communication Networks Socket Programming in C References Beej's Guide to Network Programming Official homepage: http://beej.us/guide/bgnet/ Local mirror http://www.cs.hku.hk/~c0234a/bgnet/

More information

The User Datagram Protocol

The User Datagram Protocol The User Datagram Protocol Stefan D. Bruda Winter 2018 UDP Very similar to the TCP in terms of API Dissimilar with TCP in terms of innards (and hence programming techniques) Many-to-many communication.

More information

Reference Models. 7.3 A Comparison of the OSI and TCP/IP Reference Models

Reference Models. 7.3 A Comparison of the OSI and TCP/IP Reference Models Reference Models Contains 7.1 The OSI Reference Model 7.1.1 The Physical Layer 7.1.2 The Data Link Layer 7.1.3 The Network Layer 7.1.4 The Transport Layer 7.1.5 The Session Layer 7.1.6 The Presentation

More information

Networking Applications

Networking Applications Networking Dr. Ayman A. Abdel-Hamid College of Computing and Information Technology Arab Academy for Science & Technology and Maritime Transport Multimedia Multimedia 1 Outline Audio and Video Services

More information

CSE 333 Lecture 8 - file and network I/O

CSE 333 Lecture 8 - file and network I/O CSE 333 Lecture 8 - file and network I/O Steve Gribble Department of Computer Science & Engineering University of Washington CSE333 lec 8 net // 04-13-12 // gribble Administrivia HW1 was due yesterday

More information

ECE 650 Systems Programming & Engineering. Spring 2018

ECE 650 Systems Programming & Engineering. Spring 2018 ECE 650 Systems Programming & Engineering Spring 2018 Networking Transport Layer Tyler Bletsch Duke University Slides are adapted from Brian Rogers (Duke) TCP/IP Model 2 Transport Layer Problem solved:

More information

Don Libes. National Institute of Standards and Technology Gaithersburg, MD ABSTRACT

Don Libes. National Institute of Standards and Technology Gaithersburg, MD ABSTRACT Packet-oriented Communication Using a Stream Protocol or Making TCP/IP on Berkeley UNIX a little more pleasant to use Don Libes National Institute of Standards and Technology Gaithersburg, MD 20899 ABSTRACT

More information

ECE322 Systems Programming Project 2: Networking with Matrix Multiplication in C Grant Kimes 12/16/15

ECE322 Systems Programming Project 2: Networking with Matrix Multiplication in C Grant Kimes 12/16/15 ECE322 Systems Programming Project 2: Networking with Matrix Multiplication in C Grant Kimes 12/16/15 This project take two inputted matrices of a given size to multiply. The client sends the data to a

More information

DIGITAL fountain codes are a class of code that

DIGITAL fountain codes are a class of code that IEEE TRANSACTIONS ON COMMUNICATIONS, 26 1 Efficient Fountain Codes for Medium Blocklengths Oliver G. H. Madge and David J. C. MacKay Abstract Digital fountain codes are a class of codes designed for efficient

More information

An Efficient Transmission Scheme for Media Content Distribution Platform

An Efficient Transmission Scheme for Media Content Distribution Platform International Conference on Electronic Science and Automation Control (ESAC 2015) An Efficient Transmission Scheme for Media Content Distribution Platform Feifei Wang Digital Engineering Center Communication

More information

UDP, TCP, IP multicast

UDP, TCP, IP multicast UDP, TCP, IP multicast Dan Williams In this lecture UDP (user datagram protocol) Unreliable, packet-based TCP (transmission control protocol) Reliable, connection oriented, stream-based IP multicast Process-to-Process

More information

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1 Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1 Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 23-1 PROCESS-TO-PROCESS DELIVERY 23.2 The transport

More information

Energy Savings for Video Streaming Using Fountain Coding

Energy Savings for Video Streaming Using Fountain Coding Energy Savings for Video Streaming Using Fountain Coding Anders Nilsson Plymoth TelHoc AB Stockholm, Sweden Email: anders@telhoc.se Zhi Zhang Department Of Electrical and Information Technology Lund University,

More information

How to write a Measurement Telnet Server

How to write a Measurement Telnet Server How to write a Measurement Telnet Server A measurement Telnet server allows you to access remote I/Os with a standard Telnet client program. The following samples shows a way to set the LEDs of a DNP/EVA1

More information

CS505: Distributed Systems

CS505: Distributed Systems Cristina Nita-Rotaru CS505: Distributed Systems Protocols. Slides prepared based on material by Prof. Ken Birman at Cornell University, available at http://www.cs.cornell.edu/ken/book/ Required reading

More information

Exam in Computer Networks

Exam in Computer Networks Exam in Computer Networks Date 2004-12-17 Course code 1DT633 Exam time 3/5 hours Problems 5/8, Total 50/80 points Teacher Lars-Åke Larzon Phone 070-5228109 Aid English dictionary Please read the instructions

More information

CS 428/528 Computer Networks Lecture 01. Yan Wang

CS 428/528 Computer Networks Lecture 01. Yan Wang 1 CS 428/528 Computer Lecture 01 Yan Wang 2 Motivation: Why bother? Explosive growth of networks 1989, 100,000 hosts on the Internet Distributed Applications and Systems E-mail, WWW, multimedia, distributed

More information

Networked Systems and Services, Fall 2018 Chapter 2. Jussi Kangasharju Markku Kojo Lea Kutvonen

Networked Systems and Services, Fall 2018 Chapter 2. Jussi Kangasharju Markku Kojo Lea Kutvonen Networked Systems and Services, Fall 2018 Chapter 2 Jussi Kangasharju Markku Kojo Lea Kutvonen Outline Physical layer reliability Low level reliability Parities and checksums Cyclic Redundancy Check (CRC)

More information

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING UNIT-2 2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS 2.2.1 Pure ALOHA 2.2.2 Slotted ALOHA 2.2.3 Carrier Sense Multiple Access 2.2.4 CSMA with Collision Detection 2.2.5 Collision Free Protocols 2.2.5.1

More information

Raising the Datagram API to Support Transport Protocol Evolution

Raising the Datagram API to Support Transport Protocol Evolution Raising the Datagram API to Support Transport Protocol Evolution Tom Jones, Gorry Fairhurst University of Aberdeen Colin Perkins University of Glasgow Presentation given at the IFIP Networking 2017 Workshop

More information

EEC-682/782 Computer Networks I

EEC-682/782 Computer Networks I EEC-682/782 Computer Networks I Lecture 16 Wenbing Zhao w.zhao1@csuohio.edu http://academic.csuohio.edu/zhao_w/teaching/eec682.htm (Lecture nodes are based on materials supplied by Dr. Louise Moser at

More information

Multimedia Networking

Multimedia Networking Multimedia Networking #2 Multimedia Networking Semester Ganjil 2012 PTIIK Universitas Brawijaya #2 Multimedia Applications 1 Schedule of Class Meeting 1. Introduction 2. Applications of MN 3. Requirements

More information