cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3556
Views
5
Helpful
8
Replies

DHCP Option 82 SG300, How to decipher circuitid bytes

Jonathan Fisher
Level 1
Level 1

Hey guys,

I'm having trouble figuring out the meaning of the bytes in Option82 that Cisco's SG300 switches send. The switch is in l3 mode, and I have dhcp relay setup and working great.

Looking at the packet captures, the switch always sends it's MAC address as the remote-id in option 82:

Option 82 Suboption: (2) Agent Remote ID

Length: 8

Agent Remote ID: 000634bdc8xxxxxx

34:bd:c8 is an OUI registered to Cisco Systems.

I'm having trouble deciphering the circuitid. The last couple bytes have something to do with the port:

Port 1:

0004007d0131

Port 2:

0004007d0132

Port 3

0004007d0133

Port 4

0004007d0134

Port 49:

0004007d0161

Port 50:

0004007d0162

But really what makes me scratch my head is the byte 'd' following the 0004007, call it the mystery digit. This byte systems to have a meaning connected to the type of device immediately connected. When I connected a computer, there is a 'd' there. When I connect an aastra phone, I get a '8'. When I connected a Ubiquiti networks AP, I got a '7'.

I can't figure out the numbering scheme for ports nor the meaning of the mystery digit. Any help appreciated!

2 Accepted Solutions

Accepted Solutions

Hi Jonathan with sub option 2, from your example D is the node identifier.

When seeing the variable per connection type, I would give a safe assumption it is verbose padding the sub type 1.

The verbose pad formatting for the packet should contain

sub option

length

node identifier

port type

interface number

vlan id

For normal pad format it should contain

sub option

length

circuit

length

vlan id

interface number

-Tom
Please mark answered for helpful posts

-Tom Please mark answered for helpful posts http://blogs.cisco.com/smallbusiness/

View solution in original post

Jonathan, there is not documentation. Here is the break down on the example.

0004007d0133

00 - circuit

040 - length

007d-VID=125

0133-global ID

-Tom
Please mark answered for helpful posts

-Tom Please mark answered for helpful posts http://blogs.cisco.com/smallbusiness/

View solution in original post

8 Replies 8

Tom Watts
VIP Alumni
VIP Alumni

Hi Jonathan, DHCP option 82 can support 2 sub options, the circuit ID and remote ID. There is not a unified definition and varies from vendor to vendor.

With the sub option 1, circuit ID there is verbose padding which inserts the node identifier which is what you are seeing.

-Tom
Please mark answered for helpful posts

-Tom Please mark answered for helpful posts http://blogs.cisco.com/smallbusiness/

Hey Tom, first, thank you for your answer. I really appreciate you taking a crack at it.

The option82 information here is being inserted by the Cisco switch. I completely get what you're saying when you said it varies from vendor to vendor.

So in this particular case, the vendor is Cisco and I'm trying to figure out what information Cisco is sending in the option 1 field. I've figured it out it has _something_ to do with which port # the device is connected on, but the rest of the bytes are a mystery.

Hi Jonathan with sub option 2, from your example D is the node identifier.

When seeing the variable per connection type, I would give a safe assumption it is verbose padding the sub type 1.

The verbose pad formatting for the packet should contain

sub option

length

node identifier

port type

interface number

vlan id

For normal pad format it should contain

sub option

length

circuit

length

vlan id

interface number

-Tom
Please mark answered for helpful posts

-Tom Please mark answered for helpful posts http://blogs.cisco.com/smallbusiness/

Is there documentation laying around about the verbose padding format? The hex bytes still aren't making any sense.

Jonathan, there is not documentation. Here is the break down on the example.

0004007d0133

00 - circuit

040 - length

007d-VID=125

0133-global ID

-Tom
Please mark answered for helpful posts

-Tom Please mark answered for helpful posts http://blogs.cisco.com/smallbusiness/

In case this helps anyone else,

Port #3:

0x0133 = 307 in base10

307 - 304 = 3

Port #50

0x0162 = 354

54 - 304 = 50

304 is some sort of magic constant it seems.

The SG300 uses the type 1 circuit-id format, which goes like this:

 

byte 1 - "1" indicates option 1 format

byte 2 - length of the circuit-id option in bytes, but it is always "4" for option 1

bytes 3 & 4 - VLAN id

byte 5 - Slot number; always "1" on SG300 switches

byte 6 - Port number; this is the SNMP ifIndex number

 

On the SG300 switches that I've checked, gi1 starts at ifIndex 49 and are numbered consecutively.  But ifIndex numbers do not have to be consecutive.

 

You can find out your ifIndex to name mapping, by snmpwalk'ing the ifDescr table.

 

This is what that looks like:

 

tom$ snmpwalk -v2c -c yourcommunity my-sg300.domain.com ifDesc
IF-MIB::ifDescr.49 = STRING: gigabitethernet1
IF-MIB::ifDescr.50 = STRING: gigabitethernet2
IF-MIB::ifDescr.51 = STRING: gigabitethernet3
IF-MIB::ifDescr.52 = STRING: gigabitethernet4
IF-MIB::ifDescr.53 = STRING: gigabitethernet5
IF-MIB::ifDescr.54 = STRING: gigabitethernet6
IF-MIB::ifDescr.55 = STRING: gigabitethernet7
IF-MIB::ifDescr.56 = STRING: gigabitethernet8
IF-MIB::ifDescr.57 = STRING: gigabitethernet9
IF-MIB::ifDescr.58 = STRING: gigabitethernet10
IF-MIB::ifDescr.59 = STRING: gigabitethernet11
IF-MIB::ifDescr.60 = STRING: gigabitethernet12
IF-MIB::ifDescr.61 = STRING: gigabitethernet13
IF-MIB::ifDescr.62 = STRING: gigabitethernet14
IF-MIB::ifDescr.63 = STRING: gigabitethernet15
IF-MIB::ifDescr.64 = STRING: gigabitethernet16
IF-MIB::ifDescr.65 = STRING: gigabitethernet17
IF-MIB::ifDescr.66 = STRING: gigabitethernet18
IF-MIB::ifDescr.67 = STRING: gigabitethernet19
IF-MIB::ifDescr.68 = STRING: gigabitethernet20
IF-MIB::ifDescr.69 = STRING: gigabitethernet21
IF-MIB::ifDescr.70 = STRING: gigabitethernet22
IF-MIB::ifDescr.71 = STRING: gigabitethernet23
IF-MIB::ifDescr.72 = STRING: gigabitethernet24
IF-MIB::ifDescr.73 = STRING: gigabitethernet25
IF-MIB::ifDescr.74 = STRING: gigabitethernet26
IF-MIB::ifDescr.75 = STRING: gigabitethernet27
IF-MIB::ifDescr.76 = STRING: gigabitethernet28
IF-MIB::ifDescr.77 = STRING: gigabitethernet29
IF-MIB::ifDescr.78 = STRING: gigabitethernet30
IF-MIB::ifDescr.79 = STRING: gigabitethernet31
IF-MIB::ifDescr.80 = STRING: gigabitethernet32
IF-MIB::ifDescr.81 = STRING: gigabitethernet33
IF-MIB::ifDescr.82 = STRING: gigabitethernet34
IF-MIB::ifDescr.83 = STRING: gigabitethernet35
IF-MIB::ifDescr.84 = STRING: gigabitethernet36
IF-MIB::ifDescr.85 = STRING: gigabitethernet37
IF-MIB::ifDescr.86 = STRING: gigabitethernet38
IF-MIB::ifDescr.87 = STRING: gigabitethernet39
IF-MIB::ifDescr.88 = STRING: gigabitethernet40
IF-MIB::ifDescr.89 = STRING: gigabitethernet41
IF-MIB::ifDescr.90 = STRING: gigabitethernet42
IF-MIB::ifDescr.91 = STRING: gigabitethernet43
IF-MIB::ifDescr.92 = STRING: gigabitethernet44
IF-MIB::ifDescr.93 = STRING: gigabitethernet45
IF-MIB::ifDescr.94 = STRING: gigabitethernet46
IF-MIB::ifDescr.95 = STRING: gigabitethernet47
IF-MIB::ifDescr.96 = STRING: gigabitethernet48
IF-MIB::ifDescr.97 = STRING: gigabitethernet49
IF-MIB::ifDescr.98 = STRING: gigabitethernet50
IF-MIB::ifDescr.99 = STRING: gigabitethernet51
IF-MIB::ifDescr.100 = STRING: gigabitethernet52
IF-MIB::ifDescr.1000 = STRING: Po1
IF-MIB::ifDescr.1001 = STRING: Po2
IF-MIB::ifDescr.1002 = STRING: Po3
IF-MIB::ifDescr.1003 = STRING: Po4
IF-MIB::ifDescr.1004 = STRING: Po5
IF-MIB::ifDescr.1005 = STRING: Po6
IF-MIB::ifDescr.1006 = STRING: Po7
IF-MIB::ifDescr.1007 = STRING: Po8
IF-MIB::ifDescr.3000 = STRING: tunnel1
IF-MIB::ifDescr.7000 = STRING: loopback1
IF-MIB::ifDescr.20000 = STRING: Logical-int 1
IF-MIB::ifDescr.100000 = STRING: 1
IF-MIB::ifDescr.100001 = STRING: 2
IF-MIB::ifDescr.100002 = STRING: 3
IF-MIB::ifDescr.300000 = STRING: 2

 

 

 

 

Extending samplonius's answer to the SG500X by extrapolating to stacking switches is fairly straighforward. The slot number, instead of being a constant, directly corresponds to the switchunit number. The port number is still derived from the ifIndex, but is relative to the last ifIndex of the preceding switchunit. In the example below, the last port on switchunit 2 has port 1 on switchunit 3 has ifIndex 220 and the first port on switchunit 3 has ifIndex 269, for a relative offset of 49 (0x31 in hex).

 

IF-MIB::ifDescr.203 = STRING: gigabitethernet2/1/45
IF-MIB::ifDescr.204 = STRING: gigabitethernet2/1/46
IF-MIB::ifDescr.205 = STRING: gigabitethernet2/1/47
IF-MIB::ifDescr.206 = STRING: gigabitethernet2/1/48
IF-MIB::ifDescr.217 = STRING: tengigabitethernet2/1/1
IF-MIB::ifDescr.218 = STRING: tengigabitethernet2/1/2
IF-MIB::ifDescr.219 = STRING: tengigabitethernet2/1/3
IF-MIB::ifDescr.220 = STRING: tengigabitethernet2/1/4
IF-MIB::ifDescr.269 = STRING: gigabitethernet3/1/1
IF-MIB::ifDescr.270 = STRING: gigabitethernet3/1/2
IF-MIB::ifDescr.271 = STRING: gigabitethernet3/1/3
IF-MIB::ifDescr.272 = STRING: gigabitethernet3/1/4
vlan-9-switchunit-2-port-45  → 00:04:00:09:02:5d # ifIndex 203
vlan-9-switchunit-2-port-46  → 00:04:00:09:02:5e # ifIndex 204
vlan-9-switchunit-2-port-47  → 00:04:00:09:02:5f # ifIndex 205
vlan-9-switchunit-2-port-48  → 00:04:00:09:02:60 # ifIndex 206
vlan-9-switchunit-2-port-xg1 → 00:04:00:09:02:6b # ifIndex 217
vlan-9-switchunit-2-port-xg2 → 00:04:00:09:02:6c # ifIndex 218
vlan-9-switchunit-2-port-xg3 → 00:04:00:09:02:6d # ifIndex 219
vlan-9-switchunit-2-port-xg4 → 00:04:00:09:02:6e # ifIndex 220
vlan-9-switchunit-3-port-1   → 00:04:00:09:03:31 # ifIndex 269
vlan-9-switchunit-3-port-2   → 00:04:00:09:03:32 # ifIndex 270
vlan-9-switchunit-3-port-3   → 00:04:00:09:03:33 # ifIndex 271
vlan-9-switchunit-3-port-4   → 00:04:00:09:03:34 # ifIndex 272

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Switch products supported in this community
Cisco Business Product Family
  • CBS110
  • CBS220
  • CBS250
  • CBS350
Cisco Switching Product Family
  • 110
  • 200
  • 220
  • 250
  • 300
  • 350
  • 350X
  • 550X