Question

3. If we know stream sockets make use of TCP, datagram sockets make use of UDP,...

3. If we know stream sockets make use of TCP, datagram sockets make use of UDP, and raw sockets use neither, then, why both type and protocol need to be specified in the socket() command?

Homework Answers

Answer #1

We know that socket streams make use of TCP, datagram sockets make use of UDP and raw sockets neither. But there is not always one protocol for each type used as there could be more than one type of protocol we want to use a particular type of packet transfer.

Thus if want to use the default protocol for the type of packet which we are sending then we can specify 0 as the protocol otherwise we need to specify the protocol through which we want to send.

That was a nice question to answer
Friend, If you have any doubts in understanding do let me know in the comment section. I will be happy to help you further.
Thanks

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The code I have written runs but I need it us UDP not TCP. Also I...
The code I have written runs but I need it us UDP not TCP. Also I just need someone to check my work and make sure that it works properly. The python code needs to be run with command line so you can add more than one client. The directions: 1. The chat is performed between 2 clients and not the server. 2. The server will first start up and choose a port number. Then the server prints out its...
This assignment asks you to develop a basic File Transfer Protocol (FTP) application that transmits files...
This assignment asks you to develop a basic File Transfer Protocol (FTP) application that transmits files between a client and a server using Python.Your programs should implement four FTP commands: (1) change directory(cd), (2) list directory content (ls), (3) copy a file from client to a server (put) and (4) copy a file from a server to a client (get). The project will be completed in two phases. In the first phase, all students will implement two versions of the...
please can you make it simple. For example using scanner or hard coding when it is...
please can you make it simple. For example using scanner or hard coding when it is a good idea instead of arrays and that stuff.Please just make one program (or class) and explain step by step. Also it was given to me a txt.htm 1.- Write a client program and a server program to implement the following simplified HTTP protocol based on TCP service. Please make sure your program supports multiple clients. The webpage file CS3700.htm is provided. You may...
How to use C++ figure this question? Collection and Sorted Collection An array is great for...
How to use C++ figure this question? Collection and Sorted Collection An array is great for storing a list of values. However, one challenge when working with arrays is they have a fixed size. If you declare an array of size 10 and later need to actually store 11 elements you have to create a new array and copy everything over. C++ (and other langauges) create classes that handle this and other operations behind the scenes. In this assignment, we...
Note: Do not use classes or any variables of type string to complete this assignment Write...
Note: Do not use classes or any variables of type string to complete this assignment Write a program that reads in a sequence of characters entered by the user and terminated by a period ('.'). Your program should allow the user to enter multiple lines of input by pressing the enter key at the end of each line. The program should print out a frequency table, sorted in decreasing order by number of occurences, listing each letter that ocurred along...
Write a Python 3 program called “parse.py” using the template for a Python program that we...
Write a Python 3 program called “parse.py” using the template for a Python program that we covered in this module. Note: Use this mod7.txt input file. Name your output file “output.txt”. Build your program using a main function and at least one other function. Give your input and output file names as command line arguments. Your program will read the input file, and will output the following information to the output file as well as printing it to the screen:...
Biology Unit I Homework - Nutritional Analysis Worksheet Introduction In Chapters 3 and 4 of the...
Biology Unit I Homework - Nutritional Analysis Worksheet Introduction In Chapters 3 and 4 of the textbook, you learned that the body needs various macro and micronutrients in order to function properly. You also learned about cellular metabolism and what the human body uses as a fuel source. This all seems simple at first glance; however, it can be difficult to determine whether we are getting what our body needs. Even when we know what our body needs, it becomes...
Consider the C program (twoupdate) to demonstrate race condition. In this assignment, we will implement Peterson's...
Consider the C program (twoupdate) to demonstrate race condition. In this assignment, we will implement Peterson's algorithm to ensure mutual exclusion in the respective critical sections of the two processes, and thereby eliminate the race condition. In order to implement Peterson's Algorithm, the two processes should share a boolean array calledflagwith two components and an integer variable called turn, all initialized suitably. We will create and access these shared variables using UNIX system calls relating to shared memory – shmget,...
Research suggests that it takes about 3,000 raw, unwritten ideas to produce a single, commercially-successful new...
Research suggests that it takes about 3,000 raw, unwritten ideas to produce a single, commercially-successful new product. To learn marketing lessons and convert potential failures to successes, we can analyze why new products fail and then study several failures in detail. Both marketing and nonmarketing factors contribute to new-product failures. Using the research results from several studies on new-product success and failure, we can identify critical marketing factors—which sometimes overlap—that often separate new-product winners and losers: 1. Insignificant point of...
What are your top 3 take aways from this article? Technology is no longer just for...
What are your top 3 take aways from this article? Technology is no longer just for geeks. The internet has changed everything, including marketing. Be they small, medium or large, social media grants all companies an equal playing field on which to organically reach new customers. However, success will always ride on the marketing strategy employed. Obviously, larger companies have the advantage of bigger budgets and more resources. But that doesn’t mean social media for small business owners can’t compete...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT