Home » RDBMS Server » Networking and Gateways » TNS Packet Length (Oracle Version 12c)
TNS Packet Length [message #663506] Tue, 06 June 2017 10:28 Go to next message
kreem
Messages: 5
Registered: June 2017
Junior Member
Hi experts,

I generated some captures with my database Oracle in version 12c and i am trying to get the value of the field "packet length" in the TNS header.
However, I observed that sometimes the packet length is stored in 4 bytes instead of 2 bytes.
Have you any idea how can i detect the size of the packet length ?

Thanks you in advance for your reply
Re: TNS Packet Length [message #663507 is a reply to message #663506] Tue, 06 June 2017 10:43 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
What does this question have to do with Oracle?

https://www.google.com/search?q=how+can+i+detect+the+size+of+the+packet+length
Re: TNS Packet Length [message #663508 is a reply to message #663507] Tue, 06 June 2017 10:50 Go to previous messageGo to next message
kreem
Messages: 5
Registered: June 2017
Junior Member
TNS is the protocol used by Oracle.
Re: TNS Packet Length [message #663509 is a reply to message #663508] Tue, 06 June 2017 11:02 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
kreem wrote on Tue, 06 June 2017 08:50
TNS is the protocol used by Oracle.
It use TCP/IP stack

What will you do with this number after you have it?
Re: TNS Packet Length [message #663510 is a reply to message #663509] Tue, 06 June 2017 11:24 Go to previous messageGo to next message
kreem
Messages: 5
Registered: June 2017
Junior Member
I want to analyze the packet.
Re: TNS Packet Length [message #663512 is a reply to message #663510] Tue, 06 June 2017 11:46 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
https://www.google.com/webhp?hl=en&tab=ww#hl=en&q=oracle+tns+packet+dump

https://www.wireshark.org/ or similar utility
Re: TNS Packet Length [message #663527 is a reply to message #663512] Wed, 07 June 2017 03:51 Go to previous messageGo to next message
kreem
Messages: 5
Registered: June 2017
Junior Member
I already made a research in google but anyone notice my use case.
Re: TNS Packet Length [message #663532 is a reply to message #663527] Wed, 07 June 2017 06:27 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
kreem wrote on Wed, 07 June 2017 03:51
I already made a research in google but anyone notice my use case.
How does WireShark NOT meet your use case? As BlackSwan said, oracle tns just uses tcp/ip. There's no "secret sauce" in tns.

Perhaps you need to explain in further detail exactly what you are trying to achieve. It's not at all clear what "I generated some captures with my database" really means.

[Updated on: Wed, 07 June 2017 06:28]

Report message to a moderator

Re: TNS Packet Length [message #663544 is a reply to message #663527] Wed, 07 June 2017 10:46 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
kreem wrote on Wed, 07 June 2017 01:51
I already made a research in google but anyone notice my use case.
IMO, you are on a snipe hunt.
Re: TNS Packet Length [message #663546 is a reply to message #663544] Wed, 07 June 2017 14:53 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
BlackSwan wrote on Wed, 07 June 2017 10:46
kreem wrote on Wed, 07 June 2017 01:51
I already made a research in google but anyone notice my use case.
IMO, you are on a snipe hunt.
Left-handed smoke shifter, anyone?
Or perhaps a carpenter's board stretcher.

Cool
Re: TNS Packet Length [message #663565 is a reply to message #663532] Thu, 08 June 2017 08:16 Go to previous messageGo to next message
kreem
Messages: 5
Registered: June 2017
Junior Member
There is a secret sauce in TNS. Maybe if you don't know but TNS is an application protocol (Layer 5).

Concerning Wireshark, i notice in the last developpement of the tns dissector that they check if the field "Packet Checksum" in the header is equal to 0 or 4 for
detecting the size of the field packet length.

After this observation, i decided to install the last Oracle database server so as to capture traffic between my sql client and the database.

I observed in my captures that the field "packet length" is sometimes stored in 4 bytes only for the packet type "Data" (Header Field Type=0x6) and with the field "Reserved" equal to 0x20 or 0x00. But in the same way, the field "packet length" is stored in 2 bytes with the field "Reserved" equal to 0x00.


So, which element can i use for detecting the size of the field packet length ?
Re: TNS Packet Length [message #663569 is a reply to message #663565] Thu, 08 June 2017 09:28 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
TNS.
Re: TNS Packet Length [message #663572 is a reply to message #663565] Thu, 08 June 2017 11:33 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
kreem wrote on Thu, 08 June 2017 08:16
There is a secret sauce in TNS. Maybe if you don't know but TNS is an application protocol (Layer 5).
Maybe you don't know it, but the oracle docs say it is the session layer. https://docs.oracle.com/cd/E11882_01/network.112/e41945/layers.htm#NETAG206 says
"Figure 4-2 shows how Oracle Net software consisting of the Oracle Net Foundation layer and Oracle Protocol Support fits into the session layer of the OSI model."


Quote:
I observed in my captures that the field "packet length" is sometimes stored in 4 bytes only for the packet type "Data" (Header Field Type=0x6) and with the field "Reserved" equal to 0x20 or 0x00. But in the same way, the field "packet length" is stored in 2 bytes with the field "Reserved" equal to 0x00
Is this "capture" you keep talking about a sqlnet trace? What parameters did you put in your sqlnet.ora to generate it? Was that server side or client side?

And again, what is it you are trying to get from this that you can't get from a WireShark trace?
Re: TNS Packet Length [message #663748 is a reply to message #663572] Thu, 15 June 2017 15:03 Go to previous message
Caffeine+
Messages: 14
Registered: February 2017
Junior Member
Can you post the header dump, just the portions showing the differences? I suspect that the 2-byte headers are for the fixed type messages but it should at least have an x00 or other field termination code.

FYI that if you are building a TNS packet parser/sniffer, many many thanks. Hopefully you will open-source it so it can be used new tools.
Previous Topic: Connect SQL Database from Oracle
Next Topic: LISTENER BLOCKED the instance during nomount state
Goto Forum:
  


Current Time: Thu Mar 28 09:15:18 CDT 2024