Alphaplus Posted July 30, 2016 Share Posted July 30, 2016 (edited) I am a beginner in the field and I don't know whether it is too silly to ask. What is the physical location(if any) of the four layers in TCP/IP model? Suppose I am using the application gmail, and has pressed the send button after typing in the mail when does application layer come into play and where is it located?Is it a part of the software and what of the other three layers? Edited July 30, 2016 by Alphaplus Link to comment Share on other sites More sharing options...
Sensei Posted July 30, 2016 Share Posted July 30, 2016 (edited) In socket library you have couple functions such as:socket()https://msdn.microsoft.com/en-us/library/windows/desktop/ms740506(v=vs.85).aspxIt takes couple parameters, whether socket has to be TCP or UDP, ICMP, whether it has to be IPv4 or IPv6 etc. etc.Once you have socket,you should tell socket to which IP to connect, and at which port. It's done by using connect() function: https://msdn.microsoft.com/en-us/library/windows/desktop/ms737625(v=vs.85).aspxIP can be given as series of numbers f.e. 192.168.0.1 or by name.If it's by name you should ask DNS (Domain Name Server), to what IP by numbers it will resolve.gethostbyname()https://msdn.microsoft.com/pl-pl/library/windows/desktop/ms738524(v=vs.85).aspx At the end there has to be used send() function https://msdn.microsoft.com/en-us/library/windows/desktop/ms740149(v=vs.85).aspx Example code using all functions is at the bottom of above MSDN link. Depending what protocol you're using you might want to wait for reply to arrive back using recv() https://msdn.microsoft.com/en-us/library/windows/desktop/ms740121(v=vs.85).aspx Suppose I am using the application gmail, and has pressed the send button after typing in the mail when does application layer come into play and where is it located? If you meant Android gmail application, it's probably using JavaMail API http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a Edited July 30, 2016 by Sensei 1 Link to comment Share on other sites More sharing options...
Endy0816 Posted July 30, 2016 Share Posted July 30, 2016 Network Interface Layer As to the second, you answered your own question, 'application Gmail'. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now