SummaryThe recent fog‐and‐cloud computing, Internet of things (IoT), artificial intelligence, machine learning, and store‐and‐forward datacenter applications gradually increase the Internet traffic. The arrival of this traffic is periodic, which remains high during certain time duration (known as peak or working/office hour) each day, resulting in an increase in the resource bottleneck problem, which causes high connections blocking. Due to these, many commercial and business data services may lose their connections which contain the urgent and important information. In order to handle such a critical situation in elastic optical networks (EONs), prioritization of connection requests based on the differentiated class of service (CoS) is a must. In this paper, the network traffic is categorized into three CoS requests. These are CoS1 (real‐time traffic), CoS2 (nonreal‐time traffic), and CoS3 (delay‐tolerant traffic) and proposed a cost function‐based CoS provisioning (CFCoSP) strategy in which the connection requests are served as per an increasing value of cost function. The cost function is a cumulative function of CoS, pathlength, and requested bandwidth demand (i.e., number of frequency slots required). The simulations are performed on INDIAN and ARPANET network topologies under uniform CoS ratio (i.e., CoS1:CoS2:CoS3 = 1:1:1) on the metrics of connection established, bandwidth blocking probability, resource utilization ratio, and network capacity utilization. The simulation results verify that the proposed CFCoSP strategy shows significantly improved performances as compared to an existing non‐cost CoS provisioning (CoSP) strategy on the investigated metrics.